你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Remove-AzSqlInstanceLink
删除实例链接。
语法
Remove-AzSqlInstanceLink
[-ResourceGroupName] <String>
[-InstanceName] <String>
[-Name] <String>
[-Force]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzSqlInstanceLink
[-Name] <String>
[-InstanceObject] <AzureSqlManagedInstanceModel>
[-Force]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzSqlInstanceLink
[-InputObject] <AzureSqlManagedInstanceLinkModel>
[-Force]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-AzSqlInstanceLink
[-ResourceId] <String>
[-Force]
[-PassThru]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Remove-AzSqlInstanceLink cmdlet 删除实例链接。 如果删除链接并且副本的 LSN 未与主节点同步,则此命令可能会导致数据丢失,因此用户必须在出现提示时显式确认该命令,或使用 -Force 参数。
示例
示例 1:删除实例链接
Remove-AzSqlInstanceLink -ResourceGroupName "ResourceGroup01" -InstanceName "ManagedInstance01" -Name "Link01"
This operation may cause data loss if replica's last hardened LSN is not in sync with the primary. Are you sure you want to proceed?
[Y] Yes [N] No [?] Help (default is "Y"): Y
此命令从托管实例“ManagedInstance01”中删除实例链接“Link01”。
示例 2:使用显式 -Force 标志删除实例链接
Remove-AzSqlInstanceLink -ResourceGroupName "ResourceGroup01" -InstanceName "ManagedInstance01" -Name "Link01" -Force
此命令强制删除托管实例“ManagedInstance01”中的实例链接“Link01”,忽略数据丢失警告。
示例 3:按其资源标识符删除实例链接
Remove-AzSqlInstanceLink -ResourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/ManagedInstance01/distributedAvailabilityGroups/Link01"
This operation may cause data loss if replica's last hardened LSN is not in sync with the primary. Are you sure you want to proceed?
[Y] Yes [N] No [?] Help (default is "Y"): Y
此命令删除具有指定资源 ID 的实例链接。
示例 4:通过 PowerShell 对象删除实例链接
$managedInstanceLink = Get-AzSqlInstanceLink -ResourceGroupName "ResourceGroup01" -InstanceName "ManagedInstance01" -Name "Link01"
Remove-AzSqlInstanceLink -InputObject $managedInstanceLink
This operation may cause data loss if replica's last hardened LSN is not in sync with the primary. Are you sure you want to proceed?
[Y] Yes [N] No [?] Help (default is "Y"): Y
此命令删除实例链接对象指定的实例链接。
示例 5:按其父实例对象删除实例链接
$instance = Get-AzSqlInstance -ResourceGroupName "ResourceGroup01" -Name "ManagedInstance01"
Remove-AzSqlInstanceLink -InstanceObject $instance -Name "Link01"
This operation may cause data loss if replica's last hardened LSN is not in sync with the primary. Are you sure you want to proceed?
[Y] Yes [N] No [?] Help (default is "Y"): Y
此命令从实例对象指定的托管实例中删除实例链接“Link01”。
示例 6:使用位置参数删除实例链接
Remove-AzSqlInstanceLink "ResourceGroup01" "ManagedInstance01" "Link01"
This operation may cause data loss if replica's last hardened LSN is not in sync with the primary. Are you sure you want to proceed?
[Y] Yes [N] No [?] Help (default is "Y"): Y
此命令使用位置参数从托管实例“ManagedInstance01”中删除实例链接“Link01”。
示例 7:通过管道链接对象从其父实例中删除所有实例链接
$instance = Get-AzSqlInstance -ResourceGroupName "ResourceGroup01" -Name "ManagedInstance01"
$instance | Get-AzSqlInstanceLink | Remove-AzSqlInstanceLink -Force
此命令从托管实例“ManagedInstance01”中删除所有实例链接。
示例 8:使用显式 -Force 标志删除实例链接并输出已删除的实例链接对象
Remove-AzSqlInstanceLink -ResourceGroupName "ResourceGroup01" -InstanceName "ManagedInstance01" -Name "Link01" -Force -PassThru
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 :
此命令从托管实例“ManagedInstance01”中删除实例链接,并输出已删除的实例链接对象。
参数
-Confirm
提示你在运行 cmdlet 之前进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Force
跳过执行操作的确认消息。
类型: | SwitchParameter |
别名: | AllowDataLoss |
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 |
-PassThru
定义是否返回已删除的实例链接。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | 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