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>]
Description
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
DistributedAvailabilityGroupName : Link01
DistributedAvailabilityGroupId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases : {Database01}
InstanceAvailabilityGroupName : AG_Database01_MI
PartnerAvailabilityGroupName : AG_Database01
PartnerEndpoint : TCP://SERVER01:5022
InstanceLinkRole : Secondary
PartnerLinkRole : Primary
ReplicationMode : Sync
FailoverMode : Manual
SeedingMode : Automatic
此命令會將實例連結的復寫模式設定為 「Sync」。
範例 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
DistributedAvailabilityGroupName : Link01
DistributedAvailabilityGroupId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases : {Database01}
InstanceAvailabilityGroupName : AG_Database01_MI
PartnerAvailabilityGroupName : AG_Database01
PartnerEndpoint : TCP://SERVER01:5022
InstanceLinkRole : Secondary
PartnerLinkRole : Primary
ReplicationMode : Async
FailoverMode : Manual
SeedingMode : Automatic
此命令會將實例連結的復寫模式設定為 「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
DistributedAvailabilityGroupName : Link01
DistributedAvailabilityGroupId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases : {Database01}
InstanceAvailabilityGroupName : AG_Database01_MI
PartnerAvailabilityGroupName : AG_Database01
PartnerEndpoint : TCP://SERVER01:5022
InstanceLinkRole : Secondary
PartnerLinkRole : Primary
ReplicationMode : Async
FailoverMode : Manual
SeedingMode : Automatic
此命令會將其資源標識碼設定實例連結的複寫模式設定為 「Sync」。。
範例 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
DistributedAvailabilityGroupName : Link01
DistributedAvailabilityGroupId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases : {Database01}
InstanceAvailabilityGroupName : AG_Database01_MI
PartnerAvailabilityGroupName : AG_Database01
PartnerEndpoint : TCP://SERVER01:5022
InstanceLinkRole : Secondary
PartnerLinkRole : Primary
ReplicationMode : Async
FailoverMode : Manual
SeedingMode : Automatic
此命令會使用輸入物件,將實例連結的複寫模式設定為 “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
DistributedAvailabilityGroupName : Link01
DistributedAvailabilityGroupId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases : {Database01}
InstanceAvailabilityGroupName : AG_Database01_MI
PartnerAvailabilityGroupName : AG_Database01
PartnerEndpoint : TCP://SERVER01:5022
InstanceLinkRole : Secondary
PartnerLinkRole : Primary
ReplicationMode : Async
FailoverMode : Manual
SeedingMode : Automatic
此命令會使用輸入對象來設定實例連結。
範例 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
DistributedAvailabilityGroupName : Link01
DistributedAvailabilityGroupId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Databases : {Database01}
InstanceAvailabilityGroupName : AG_Database01_MI
PartnerAvailabilityGroupName : AG_Database01
PartnerEndpoint : TCP://SERVER01:5022
InstanceLinkRole : Secondary
PartnerLinkRole : Primary
ReplicationMode : Async
FailoverMode : Manual
SeedingMode : Automatic
此命令會使用父實例物件,將實例連結的複寫模式設定為 “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
受控實例的名稱。
類型: | 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
受控實例連結的複寫模式。 在建立連結期間,將會忽略參數。
類型: | String |
Position: | 3 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ResourceGroupName
資源群組的名稱。
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ResourceId
實例鏈接資源標識碼。
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。
類型: | SwitchParameter |
別名: | wi |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
輸入
AzureSqlManagedInstanceLinkModel
輸出
AzureSqlManagedInstanceLinkModel