共用方式為


az sql instance-failover-group

管理 SQL 實例故障轉移群組。

命令

名稱 Description 類型 狀態
az sql instance-failover-group create

建立兩個連線受控實例之間的實例故障轉移群組。

Core GA
az sql instance-failover-group delete

刪除故障轉移群組。

Core GA
az sql instance-failover-group set-primary

從目前主要受控實例故障轉移所有資料庫,以設定實例故障轉移群組的主要複本。

Core GA
az sql instance-failover-group show

取得故障轉移群組。

Core GA
az sql instance-failover-group update

更新實例故障轉移群組。

Core GA

az sql instance-failover-group create

建立兩個連線受控實例之間的實例故障轉移群組。

如果主伺服器上發生中斷,寬限期表示 Azure SQL 受控資料庫不會在寬限期到期之前起始自動故障轉移。 請注意,使用 --allow-data-loss 選項的故障轉移作業可能會導致數據遺失,因為異步同步處理的性質。

az sql instance-failover-group create --mi --source-mi
                                      --name
                                      --partner-mi
                                      --partner-resource-group
                                      --resource-group
                                      [--failover-policy {Automatic, Manual}]
                                      [--grace-period]
                                      [--secondary-type]

必要參數

--mi --source-mi

Azure SQL 受控實例的名稱。

--name -n

實例故障轉移群組的名稱。

--partner-mi

實例故障轉移群組之夥伴受控實例的名稱。

--partner-resource-group

夥伴受控實例的資源群組名稱。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

選擇性參數

下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。

--failover-policy

實例故障轉移群組的故障轉移原則。

屬性
預設值: Automatic
接受的值: Automatic, Manual
--grace-period

如果在主伺服器上發生中斷,則起始自動故障轉移之前的小時間隔。 這表示 Azure SQL Database 不會在寬限期到期之前起始自動故障轉移。 請注意,使用 --allow-data-loss 選項的故障轉移作業可能會導致數據遺失,因為異步同步處理的性質。

屬性
預設值: 1
--secondary-type

故障轉移群組中次要實例的預期用法。 待命表示次要實例將作為被動復本,僅供災害復原使用。

屬性
預設值: Geo
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

輸出格式。

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az sql instance-failover-group delete

刪除故障轉移群組。

az sql instance-failover-group delete --location
                                      --name
                                      --resource-group

必要參數

--location -l

Location. 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location>來設定預設位置。

--name -n

實例故障轉移群組的名稱。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

輸出格式。

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az sql instance-failover-group set-primary

從目前主要受控實例故障轉移所有資料庫,以設定實例故障轉移群組的主要複本。

az sql instance-failover-group set-primary --location
                                           --name
                                           --resource-group
                                           [--allow-data-loss]

必要參數

--location -l

實例故障轉移群組中次要實例的位置。 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location>來設定預設位置。

--name -n

實例故障轉移群組的名稱。

--resource-group -g

實例故障轉移群組中次要實例的資源群組名稱。 您可以使用 az configure --defaults group=<name>來設定預設群組。

選擇性參數

下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。

--allow-data-loss

即使這樣做可能會導致數據遺失,也請完成故障轉移。 這可讓故障轉移繼續,即使主資料庫無法使用也一樣。

屬性
預設值: False
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

輸出格式。

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az sql instance-failover-group show

取得故障轉移群組。

az sql instance-failover-group show --location
                                    --name
                                    --resource-group

必要參數

--location -l

Location. 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location>來設定預設位置。

--name -n

實例故障轉移群組的名稱。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

輸出格式。

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False

az sql instance-failover-group update

更新實例故障轉移群組。

az sql instance-failover-group update --location
                                      --name
                                      --resource-group
                                      [--add]
                                      [--failover-policy {Automatic, Manual}]
                                      [--force-string]
                                      [--grace-period]
                                      [--remove]
                                      [--secondary-type]
                                      [--set]

必要參數

--location -l

Location. 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location>來設定預設位置。

--name -n

實例故障轉移群組的名稱。

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

選擇性參數

下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。

--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例: --add property.listProperty <key=value, string or JSON string>.

屬性
參數群組: Generic Update Arguments
預設值: []
--failover-policy

實例故障轉移群組的故障轉移原則。

屬性
接受的值: Automatic, Manual
--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

屬性
參數群組: Generic Update Arguments
預設值: False
--grace-period

如果在主伺服器上發生中斷,則起始自動故障轉移之前的小時間隔。 這表示 Azure SQL Database 不會在寬限期到期之前起始自動故障轉移。 請注意,使用 --allow-data-loss 選項的故障轉移作業可能會導致數據遺失,因為異步同步處理的性質。

--remove

從清單中移除屬性或專案。 範例: --remove property.list <indexToRemove>--remove propertyToRemove

屬性
參數群組: Generic Update Arguments
預設值: []
--secondary-type

故障轉移群組中次要實例的預期用法。 待命表示次要實例將作為被動復本,僅供災害復原使用。

--set

指定要設定的屬性路徑和值,以更新物件。 範例: --set property1.property2=<value>.

屬性
參數群組: Generic Update Arguments
預設值: []
全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

輸出格式。

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False