共用方式為


az postgres server replica

管理讀取複本。

命令

名稱 Description 類型 狀態
az postgres server replica create

建立伺服器的讀取複本。

Core GA
az postgres server replica list

列出指定伺服器的所有讀取複本。

Core GA
az postgres server replica stop

停止複寫至讀取複本,並將其設為讀取/寫入伺服器。

Core GA

az postgres server replica create

建立伺服器的讀取複本。

az postgres server replica create --name
                                  --resource-group
                                  --source-server
                                  [--location]
                                  [--no-wait]
                                  [--sku-name]

範例

為 'testsvr' 建立讀取複本 'testreplsvr'。

az postgres server replica create -n testreplsvr -g testgroup -s testsvr

為 'testsvr2' 建立讀取複本 'testreplsvr',其中 'testreplsvr' 位於不同的資源群組中。

az postgres server replica create -n testreplsvr -g testgroup \
    -s "/subscriptions/${SubID}/resourceGroups/${ResourceGroup}/providers/Microsoft.DBforPostgreSQL/servers/testsvr2"

必要參數

--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

--resource-group -g

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

--source-server -s

建立複本之主伺服器的名稱或資源標識碼。

選擇性參數

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

--location -l

Location. 值的來源:az account list-locations。 如果未提供,則建立複本會位於與主伺服器相同的位置。

--no-wait

請勿等候長時間執行的作業完成。

屬性
預設值: False
--sku-name

SKU 的名稱。 遵循慣例 {定價層}{計算產生}{vCores} 的速記。 範例:B_Gen5_1、GP_Gen5_4、MO_Gen5_16。

全域參數
--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 postgres server replica list

列出指定伺服器的所有讀取複本。

az postgres server replica list [--ids]
                                [--resource-group]
                                [--server-name]
                                [--subscription]

範例

列出主伺服器 『testsvr』 的所有讀取複本。

az postgres server replica list -g testgroup -s testsvr

選擇性參數

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

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

屬性
參數群組: Resource Id Arguments
--resource-group -g

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

屬性
參數群組: Resource Id Arguments
--server-name -s

主伺服器的名稱。

屬性
參數群組: Resource Id Arguments
--subscription

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

屬性
參數群組: Resource Id Arguments
全域參數
--debug

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

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

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

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

輸出格式。

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

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

--verbose

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

屬性
預設值: False

az postgres server replica stop

停止複寫至讀取複本,並將其設為讀取/寫入伺服器。

az postgres server replica stop [--ids]
                                [--name]
                                [--resource-group]
                                [--subscription]
                                [--yes]

範例

停止復寫至 'testreplsvr',並將其設為讀取/寫入伺服器。

az postgres server replica stop -g testgroup -n testreplsvr

選擇性參數

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

--ids

一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

屬性
參數群組: Resource Id Arguments
--name -n

伺服器的名稱。 名稱只能包含小寫字母、數字及連字號 (-) 字元。 最少 3 個字元,最多 63 個字元。

屬性
參數群組: Resource Id Arguments
--resource-group -g

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

屬性
參數群組: Resource Id Arguments
--subscription

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

屬性
參數群組: Resource Id Arguments
--yes -y

請勿提示確認。

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

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

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

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

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

輸出格式。

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

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

--verbose

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

屬性
預設值: False