本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
在 Amazon RDS 中複製資料庫參數群組
您可複製所建立的自訂資料庫參數群組。複製參數群組可以是便利的解決方案。範例是在您已建立資料庫參數群組,並希望將其大部份的自訂參數及值併入新的資料庫參數群組時。您可以使用 複製資料庫參數群組 AWS Management Console。您也可以使用 AWS CLI copy-db-parameter-group 命令或 RDS API CopyDBParameterGroup 操作。
複製資料庫參數群組後,請等待至少 5 分鐘,然後再建立第一個使用該資料庫參數群組做為預設參數群組的資料庫執行個體。執行此動作允許 Amazon RDS 在使用參數群組前,完整完成複製動作。這對建立資料庫執行個體預設資料庫時的關鍵參數尤其重要。例如 character_set_database 參數定義的預設資料庫字元集。請使用 Amazon RDS 主控台
注意
您無法複製預設參數群組。但您可以依照預設參數群組建立新的參數群組。
您無法將資料庫參數群組複製到不同的 AWS 帳戶 或 AWS 區域。
複製資料庫參數群組
-
登入 AWS Management Console ,並在 https://console.aws.amazon.com/rds/
:// 開啟 Amazon RDS 主控台。 -
在導覽窗格中,選擇 Parameter groups (參數群組)。
-
在清單中,選擇您要複製的自訂參數群組。
-
針對 Parameter group actions (參數群組動作),選擇 Copy (複製)。
-
在 New DB parameter group identifier (新資料庫參數群組識別符) 中,輸入新參數群組的名稱。
-
在 Description (描述) 中,輸入新參數群組的描述。
-
請選擇 Copy (複製)。
若要複製資料庫參數群組,請使用 AWS CLI copy-db-parameter-group 命令搭配下列必要選項:
-
--source-db-parameter-group-identifier -
--target-db-parameter-group-identifier -
--target-db-parameter-group-description
以下範例會建立名為 mygroup2 的新資料庫參數群組,該群組為資料庫參數群組 mygroup1 的複本。
範例
針對 Linux、macOS 或 Unix:
aws rds copy-db-parameter-group \ --source-db-parameter-group-identifiermygroup1\ --target-db-parameter-group-identifiermygroup2\ --target-db-parameter-group-description"DB parameter group 2"
在 Windows 中:
aws rds copy-db-parameter-group ^ --source-db-parameter-group-identifiermygroup1^ --target-db-parameter-group-identifiermygroup2^ --target-db-parameter-group-description"DB parameter group 2"
若要複製資料庫參數群組,請使用 RDS API CopyDBParameterGroup 參數並搭配下列必要參數:
-
SourceDBParameterGroupIdentifier -
TargetDBParameterGroupIdentifier -
TargetDBParameterGroupDescription