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

Get-AzSqlInstanceDatabaseMoveOperation

获取托管数据库移动操作详细信息

语法

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>]

说明

Get-AzSqlInstanceDatabaseMoveOperation cmdlet 获取移动托管数据库操作详细信息。

示例

示例 1:获取单个Azure SQL 托管实例上的所有移动操作

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               :

此命令将返回资源组 RG1 中 instance1 的所有移动操作。

示例 2:获取对一个数据库的Azure SQL 托管实例的所有移动操作

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               :

此命令将返回资源组 RG1 中实例 RG1 实例 1 上数据库 db2 的所有移动操作。

示例 3:仅获取针对一个数据库的Azure SQL 托管实例的最新移动操作

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               :

此命令将返回资源组 RG1 中实例 RG1 实例 1 上的数据库 db2 的最新移动操作。

参数

-DatabaseName

Azure SQL 托管实例上的数据库的名称。

类型:String
别名:Name
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-DatabaseObject

托管数据库对象。

类型:AzureSqlManagedDatabaseModel
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

类型:IAzureContextContainer
别名:AzContext, AzureRmContext, AzureCredential
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-InstanceName

实例的名称。

类型:String
Position:1
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-ModelObject

使用 -PassThru 参数从开始移动或复制操作返回的对象。

类型:MoveCopyManagedDatabaseModel
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-OnlyLatestPerDatabase

仅返回每个托管数据库的最新操作

类型:SwitchParameter
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-ResourceGroupName

资源组的名称。

类型:String
Position:0
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-ResourceId

托管数据库的资源 ID。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:True
接受通配符:False

-TargetInstanceName

目标Azure SQL 托管实例的名称。

类型:String
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-TargetResourceGroupName

目标资源组的名称。

类型:String
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

输入

String

AzureSqlManagedDatabaseModel

MoveCopyManagedDatabaseModel

输出

ManagedDatabaseMoveCopyOperation