편집

다음을 통해 공유


Get-AzSqlInstanceDatabaseCopyOperation

Get managed database copy operation details

Syntax

Get-AzSqlInstanceDatabaseCopyOperation
   [-DatabaseName <String>]
   [-TargetResourceGroupName <String>]
   [-TargetInstanceName <String>]
   [-OnlyLatestPerDatabase]
   [-InstanceName] <String>
   [-ResourceGroupName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzSqlInstanceDatabaseCopyOperation
   [-DatabaseName <String>]
   [-TargetResourceGroupName <String>]
   [-TargetInstanceName <String>]
   -DatabaseObject <AzureSqlManagedDatabaseModel>
   [-OnlyLatestPerDatabase]
   [-InstanceName] <String>
   [-ResourceGroupName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzSqlInstanceDatabaseCopyOperation
   [-DatabaseName <String>]
   [-TargetResourceGroupName <String>]
   [-TargetInstanceName <String>]
   -ModelObject <MoveCopyManagedDatabaseModel>
   [-OnlyLatestPerDatabase]
   [-InstanceName] <String>
   [-ResourceGroupName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzSqlInstanceDatabaseCopyOperation
   [-TargetResourceGroupName <String>]
   [-TargetInstanceName <String>]
   -ResourceId <String>
   [-OnlyLatestPerDatabase]
   [-InstanceName] <String>
   [-ResourceGroupName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzSqlInstanceDatabaseCopyOperation cmdlet get copy managed database operation details.

Examples

Example 1: Get all copy operation on single Azure SQL Managed Instance

Get-AzSqlInstanceDatabaseCopyOperation -ResourceGroupName RG1 -InstanceName instance1

Name                      : 11111111-1111-1111-1111-111111111111
Id                        : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microso
                            ft.Sql/locations/westcentralus/managedDatabaseMoveOperationResults/11111111-1111-1111-1111-111111111111
Operation                 : StartCrossManagedInstanceDatabaseMovement
OperationFriendlyName     : Start Azure SQL Managed Instance database copy
StartTime                 : 5/30/2023 10:11:21 AM
State                     : Succeeded
OperationMode             : Copy
SourceManagedInstanceName : instance1
TargetManagedInstanceName : instance2
SourceManagedInstanceId   : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microso
                            ft.Sql/managedInstances/instance1
TargetManagedInstanceId   : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microsoft.Sql/managedInstances/instance2
SourceDatabaseName        : db1
TargetDatabaseName        : db1
IsCancellable             : True
ErrorCode                 :
ErrorDescription          :
ErrorSeverity             :
IsUserError               :

Name                      : 22222222-2222-2222-2222-222222222222
Id                        : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microso
                            ft.Sql/locations/westcentralus/managedDatabaseMoveOperationResults/22222222-2222-2222-2222-222222222222
Operation                 : StartCrossManagedInstanceDatabaseMovement
OperationFriendlyName     : Start Azure SQL Managed Instance database copy
StartTime                 : 5/30/2023 10:11:21 AM
State                     : Succeeded
OperationMode             : Copy
SourceManagedInstanceName : instance1
TargetManagedInstanceName : instance3
SourceManagedInstanceId   : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microso
                            ft.Sql/managedInstances/instance1
TargetManagedInstanceId   : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microsoft.Sql/managedInstances/instance3
SourceDatabaseName        : db2
TargetDatabaseName        : db2
IsCancellable             : True
ErrorCode                 :
ErrorDescription          :
ErrorSeverity             :
IsUserError               :

Name                      : 33333333-3333-3333-3333-333333333333
Id                        : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microso
                            ft.Sql/locations/westcentralus/managedDatabaseMoveOperationResults/33333333-3333-3333-3333-333333333333
Operation                 : CancelCrossManagedInstanceDatabaseMovement
OperationFriendlyName     : Cancel Azure SQL Managed Instance database copy
StartTime                 : 5/30/2023 11:11:21 AM
State                     : Succeeded
OperationMode             : Copy
SourceManagedInstanceName : instance1
TargetManagedInstanceName : instance3
SourceManagedInstanceId   : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microso
                            ft.Sql/managedInstances/instance1
TargetManagedInstanceId   : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microsoft.Sql/managedInstances/instance3
SourceDatabaseName        : db2
TargetDatabaseName        : db2
IsCancellable             : False
ErrorCode                 :
ErrorDescription          :
ErrorSeverity             :
IsUserError               :

This command will return all copy operations for instance instance1 in resource group RG1.

Example 2: Get all copy operations on Azure SQL Managed Instance for one database

Get-AzSqlInstanceDatabaseCopyOperation -ResourceGroupName RG1 -InstanceName instance1 -DatabaseName db2

Name                      : 22222222-2222-2222-2222-222222222222
Id                        : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microso
                            ft.Sql/locations/westcentralus/managedDatabaseMoveOperationResults/22222222-2222-2222-2222-222222222222
Operation                 : StartCrossManagedInstanceDatabaseMovement
OperationFriendlyName     : Start Azure SQL Managed Instance database copy
StartTime                 : 5/30/2023 10:11:21 AM
State                     : Succeeded
OperationMode             : Copy
SourceManagedInstanceName : instance1
TargetManagedInstanceName : instance3
SourceManagedInstanceId   : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microso
                            ft.Sql/managedInstances/instance1
TargetManagedInstanceId   : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microsoft.Sql/managedInstances/instance3
SourceDatabaseName        : db2
TargetDatabaseName        : db2
IsCancellable             : True
ErrorCode                 :
ErrorDescription          :
ErrorSeverity             :
IsUserError               :


Name                      : 33333333-3333-3333-3333-333333333333
Id                        : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microso
                            ft.Sql/locations/westcentralus/managedDatabaseMoveOperationResults/33333333-3333-3333-3333-333333333333
Operation                 : CancelCrossManagedInstanceDatabaseMovement
OperationFriendlyName     : Cancel Azure SQL Managed Instance database copy
StartTime                 : 5/30/2023 11:11:21 AM
State                     : Succeeded
OperationMode             : Copy
SourceManagedInstanceName : instance1
TargetManagedInstanceName : instance3
SourceManagedInstanceId   : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microso
                            ft.Sql/managedInstances/instance1
TargetManagedInstanceId   : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microsoft.Sql/managedInstances/instance3
SourceDatabaseName        : db2
TargetDatabaseName        : db2
IsCancellable             : False
ErrorCode                 :
ErrorDescription          :
ErrorSeverity             :
IsUserError               :

This command will return all copy operations for database db2 on instance instance1 in resource group RG1.

Example 3: Get only latest copy operation on Azure SQL Managed Instance for one database

Get-AzSqlInstanceDatabaseCopyOperation -ResourceGroupName RG1 -InstanceName instance1 -DatabaseName db2 -OnlyLatestPerDatabase

Name                      : 33333333-3333-3333-3333-333333333333
Id                        : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microso
                            ft.Sql/locations/westcentralus/managedDatabaseMoveOperationResults/33333333-3333-3333-3333-333333333333
Operation                 : CancelCrossManagedInstanceDatabaseMovement
OperationFriendlyName     : Cancel Azure SQL Managed Instance database copy
StartTime                 : 5/30/2023 11:11:21 AM
State                     : Succeeded
OperationMode             : Copy
SourceManagedInstanceName : instance1
TargetManagedInstanceName : instance3
SourceManagedInstanceId   : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microso
                            ft.Sql/managedInstances/instance1
TargetManagedInstanceId   : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG1/providers/Microsoft.Sql/managedInstances/instance3
SourceDatabaseName        : db2
TargetDatabaseName        : db2
IsCancellable             : False
ErrorCode                 :
ErrorDescription          :
ErrorSeverity             :
IsUserError               :

This command will return latest copy operation for database db2 on instance instance1 in resource group RG1.

Parameters

-DatabaseName

Name of a database on Azure SQL Managed Instance.

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

-DatabaseObject

Managed database object.

Type:AzureSqlManagedDatabaseModel
Position:Named
Default value:None
Required:True
Accept pipeline input:True
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

-InstanceName

The name of the instance.

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

-ModelObject

Object that is returned from start move or copy operation using -PassThru parameter.

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

-OnlyLatestPerDatabase

Return only latest opereation per managed database

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

-ResourceGroupName

The name of the resource group.

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

-ResourceId

Resource id of managed database.

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

-TargetInstanceName

Name of the target Azure SQL Managed Instance.

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

-TargetResourceGroupName

Name of the target resource group.

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

Inputs

String

AzureSqlManagedDatabaseModel

MoveCopyManagedDatabaseModel

Outputs

ManagedDatabaseMoveCopyOperation