你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Update-AzSqlInstanceLink
更新实例链接的属性。
语法
Update-AzSqlInstanceLink
[-ResourceGroupName] <String>
[-InstanceName] <String>
[-Name] <String>
[-ReplicationMode] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzSqlInstanceLink
[-Name] <String>
[-ReplicationMode] <String>
[-InstanceObject] <AzureSqlManagedInstanceModel>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzSqlInstanceLink
[[-ReplicationMode] <String>]
[-InputObject] <AzureSqlManagedInstanceLinkModel>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzSqlInstanceLink
[-ReplicationMode] <String>
[-ResourceId] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Update-AzSqlInstanceLink cmdlet 修改实例链接的属性。
示例
示例 1:将实例链接的复制模式设置为“同步”
Update-AzSqlInstanceLink -ResourceGroupName "ResourceGroup1" -InstanceName "ManagedInstance01" -Name "Link01" -ReplicationMode "Sync"
ResourceGroupName : ResourceGroup01
InstanceName : ManagedInstance01
Type : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01
Name : Link01
TargetDatabase : Database01
SourceEndpoint : TCP://SERVER01:5022
PrimaryAvailabilityGroupName :
SecondaryAvailabilityGroupName :
ReplicationMode : Sync
DistributedAvailabilityGroupId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SourceReplicaId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
TargetReplicaId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
LinkState : Copying
LastHardenedLsn :
此命令将实例链接的复制模式设置为“同步”。
示例 2:将实例链接的复制模式设置为 Async
Update-AzSqlInstanceLink -ResourceGroupName "ResourceGroup1" -InstanceName "ManagedInstance01" -Name "Link01" -ReplicationMode "Async"
ResourceGroupName : ResourceGroup01
InstanceName : ManagedInstance01
Type : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01
Name : Link01
TargetDatabase : Database01
SourceEndpoint : TCP://SERVER01:5022
PrimaryAvailabilityGroupName :
SecondaryAvailabilityGroupName :
ReplicationMode : Async
DistributedAvailabilityGroupId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SourceReplicaId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
TargetReplicaId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
LinkState : Copying
LastHardenedLsn :
此命令将实例链接的复制模式设置为“Aync”。
示例 3:按实例资源标识符设置实例链接的复制模式
Update-AzSqlInstanceLink -ResourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01" -ReplicationMode "Async"
ResourceGroupName : ResourceGroup01
InstanceName : ManagedInstance01
Type : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01
Name : Link01
TargetDatabase : Database01
SourceEndpoint : TCP://SERVER01:5022
PrimaryAvailabilityGroupName :
SecondaryAvailabilityGroupName :
ReplicationMode : Async
DistributedAvailabilityGroupId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SourceReplicaId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
TargetReplicaId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
LinkState : Copying
LastHardenedLsn :
此命令按资源标识符将实例链接的复制模式设置为“同步”。
示例 4:通过其 PowerShell 对象设置实例链接的复制模式
$managedInstanceLink = Get-AzSqlInstanceLink -ResourceGroupName "ResourceGroup01" -InstanceName "ManagedInstance01" -Name "Link01"
Update-AzSqlInstanceLink -InputObject $managedInstanceLink -ReplicationMode "Async"
ResourceGroupName : ResourceGroup01
InstanceName : ManagedInstance01
Type : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01
Name : Link01
TargetDatabase : Database01
SourceEndpoint : TCP://SERVER01:5022
PrimaryAvailabilityGroupName :
SecondaryAvailabilityGroupName :
ReplicationMode : Async
DistributedAvailabilityGroupId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SourceReplicaId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
TargetReplicaId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
LinkState : Copying
LastHardenedLsn :
此命令使用输入对象将实例链接的复制模式设置为“Async”。
示例 5:通过改变实例链接对象的复制模式
$managedInstanceLink = Get-AzSqlInstanceLink -ResourceGroupName "ResourceGroup01" -InstanceName "ManagedInstance01" -Name "Link01"
$managedInstanceLink.ReplicationMode = "Async"
Update-AzSqlInstanceLink -InputObject $managedInstanceLink
ResourceGroupName : ResourceGroup01
InstanceName : ManagedInstance01
Type : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01
Name : Link01
TargetDatabase : Database01
SourceEndpoint : TCP://SERVER01:5022
PrimaryAvailabilityGroupName :
SecondaryAvailabilityGroupName :
ReplicationMode : Async
DistributedAvailabilityGroupId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SourceReplicaId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
TargetReplicaId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
LinkState : Copying
LastHardenedLsn :
此命令使用输入对象设置实例链接。
示例 6:按实例父实例对象设置实例链接的复制模式
$instance = Get-AzSqlInstance -ResourceGroupName "ResourceGroup01" -Name "ManagedInstance01"
Update-AzSqlInstanceLink -InstanceObject $instance -Name "Link01" -ReplicationMode "Async"
ResourceGroupName : ResourceGroup01
InstanceName : ManagedInstance01
Type : Microsoft.Sql/managedInstances/distributedAvailabilityGroups
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01
Name : Link01
TargetDatabase : Database01
SourceEndpoint : TCP://SERVER01:5022
PrimaryAvailabilityGroupName :
SecondaryAvailabilityGroupName :
ReplicationMode : Async
DistributedAvailabilityGroupId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SourceReplicaId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
TargetReplicaId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
LinkState : Copying
LastHardenedLsn :
此命令使用父实例对象将实例链接的复制模式设置为“Async”。
参数
-Confirm
提示你在运行 cmdlet 之前进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-InputObject
实例链接输入对象。
类型: | AzureSqlManagedInstanceLinkModel |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-InstanceName
Azure SQL 托管实例的名称。
类型: | String |
Position: | 1 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-InstanceObject
实例输入对象。
类型: | AzureSqlManagedInstanceModel |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-Name
实例链接的名称。
类型: | String |
别名: | LinkName |
Position: | 2 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ReplicationMode
复制模式值。 可能的值包括“Sync”和“Async”。
类型: | String |
Position: | 3 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
资源组的名称。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceId
实例链接资源 ID。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
输入
AzureSqlManagedInstanceLinkModel
输出
AzureSqlManagedInstanceLinkModel