你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Get-AzSqlInstanceDatabaseMoveOperation

Get managed database move operation details

Syntax

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

Description

The Get-AzSqlInstanceDatabaseMoveOperation cmdlet get move managed database operation details.

Examples

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

Get-AzSqlInstanceDatabaseMoveOperation -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 move
StartTime                 : 5/30/2023 10:11:21 AM
State                     : Succeeded
OperationMode             : Move
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 move
StartTime                 : 5/30/2023 10:11:21 AM
State                     : Succeeded
OperationMode             : Move
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 move
StartTime                 : 5/30/2023 11:11:21 AM
State                     : Succeeded
OperationMode             : Move
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 move operations for instance instance1 in resource group RG1.

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

Get-AzSqlInstanceDatabaseMoveOperation -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 move
StartTime                 : 5/30/2023 10:11:21 AM
State                     : Succeeded
OperationMode             : Move
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 move
StartTime                 : 5/30/2023 11:11:21 AM
State                     : Succeeded
OperationMode             : Move
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 move operations for database db2 on instance instance1 in resource group RG1.

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

Get-AzSqlInstanceDatabaseMoveOperation -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 move
StartTime                 : 5/30/2023 11:11:21 AM
State                     : Succeeded
OperationMode             : Move
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 move 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