편집

다음을 통해 공유


Get-AzCosmosDBSqlRestorableDatabase

Gets the list of all the restorable Azure Cosmos DB Sql databases available under the restorable account.

Syntax

Get-AzCosmosDBSqlRestorableDatabase
   -Location <String>
   -DatabaseAccountInstanceId <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzCosmosDBSqlRestorableDatabase
   -InputObject <PSRestorableDatabaseAccountGetResult>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Gets the list of all the restorable Azure Cosmos DB Sql databases available under the restorable account. The list would have entries corresponding to create, replace and delete events of all live and deleted databases. This list is useful to identify the restore timestamp based on the changes in the database. For example, if user wants to restore the database account to a timestamp when a database named foo is deleted, the user can find corresponding database delete event from this list, and choose a timestamp before the delete event for restore.

Examples

Example 1

Get-AzCosmosDBSqlRestorableDatabase -Location "location" -DatabaseAccountInstanceId "DatabaseAccountInstanceId"

Name            : cb04fbfc-4142-413d-b2c5-c91723a17e28
Id              : /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{DatabaseAccountInstanceId}/restorableSqlDatabases/cb04fbfc-4142-413d-b2c5-c91723
                  a17e28
Type            : Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableSqlDatabases
_rid            : a+35ZwAAAA==
OperationType   : Create
EventTimestamp  : 01/20/2021 18:42:37
OwnerId         : foo-db1
OwnerResourceId : Ts0YAA==
Database        : Microsoft.Azure.Management.CosmosDB.Models.PSRestorableSqlDatabasePropertiesResourceDatabase

The resource object contains the properties of the database resource

Parameters

-DatabaseAccountInstanceId

The instance Id of the CosmosDB database account. (This is returned as a part of database account properties).

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

CosmosDB Restorable Database Account object

Type:PSRestorableDatabaseAccountGetResult
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Location

Name of the Location in string.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

PSRestorableSqlDatabaseGetResult