刪除 Aurora Serverless v1 資料庫叢集 - Amazon Aurora

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

刪除 Aurora Serverless v1 資料庫叢集

當您使用 Aurora Serverless v1 建立 AWS Management Console 資料庫叢集時,除非您取消選取 Enable default protection (啟用預設保護) 選項,否則預設會啟用此選項。這表示您無法立即刪除已啟用 Deletion protection (刪除保護) 的 Aurora Serverless v1 資料庫叢集。若要使用 Aurora Serverless v1 刪除具有刪除保護的 AWS Management Console 資料庫叢集,您必須先修改叢集以移除此保護。如需有關使用此任務的 AWS CLI 資訊,請參閱 AWS CLI

使用 AWS Management Console 來停用刪除保護
  1. 登入 AWS Management Console,開啟位於 https://console.aws.amazon.com/rds/ 的 Amazon RDS 主控台。

  2. 在導覽窗格中,選擇 DB clusters (資料庫叢集)。

  3. 從清單中選擇 Aurora Serverless v1 資料庫叢集。

  4. 選擇 Modify (修改) 以開啟資料庫叢集的組態。「修改資料庫叢集」頁面會開啟 Aurora Serverless v1 資料庫叢集的設定、容量設定和其他組態詳細資訊。刪除保護位於 Additional configuration (其他組態) 區段中。

  5. 取消勾選 Additional configuration (其他組態) 屬性卡中的 Enable deletion protection (啟用刪除保護) 核取方塊。

  6. 選擇 Continue (繼續)。此時系統會顯示 Summary of modifications (修改摘要)

  7. 選擇 Modify cluster (修改叢集) 以接受修改摘要。您也可以選擇 Back (上一步) 修改變更,或 Cancel (取消) 捨棄變更。

在刪除保護不再處於作用中狀態之後,您就可以使用 Aurora Serverless v1 刪除 AWS Management Console 資料庫叢集。

刪除 Aurora Serverless v1 資料庫叢集
  1. 登入 AWS Management Console,開啟位於 https://console.aws.amazon.com/rds/ 的 Amazon RDS 主控台。

  2. Resources (資源) 區段中,選擇 DB Clusters (資料庫叢集)

  3. 選擇您要刪除的 Aurora Serverless v1 資料庫叢集。

  4. 對於 Actions (動作),請選擇 Delete (刪除)。系統會提示您確認是否要刪除 Aurora Serverless v1 資料庫叢集。

  5. 我們建議您保留預先選取的選項:

    • Create final snapshot? (是否建立最後的快照?)Yes (是)

    • Final snapshot name (最終快照名稱) 的 Aurora Serverless v1 資料庫叢集名稱加上 -final-snapshot。但是,您可以在此欄位中變更最終快照的名稱。

    刪除 Aurora Serverless v1 資料庫叢集的螢幕擷取畫面

    如果您為 [建立最終快照] 選擇 [否]? 您無法使用快照或 point-in-time 復原來還原資料庫叢集。

  6. 選擇 Delete DB cluster (刪除資料庫叢集)

Aurora Serverless v1 會刪除您的資料庫叢集。如果您選擇擁有最終快照,則會在 Aurora Serverless v1 資料庫叢集刪除之前看到資料庫叢集的狀態變更為「備份」,且不再出現在清單中。

開始之前,請使用 AWS 存取金鑰 ID、AWS 私密存取金鑰和 Aurora Serverless v1 資料庫叢集所在的 AWS 區域 設定 AWS CLI。如需詳細資訊,請參閱《AWS Command Line Interface 使用者指南》中的組態基礎概念

您必須先停用使用此選項設定之叢集的刪除保護,才能刪除 Aurora Serverless v1 資料庫叢集。如果您嘗試刪除已啟用此保護選項的叢集,您會看到下列錯誤訊息。

An error occurred (InvalidParameterCombination) when calling the DeleteDBCluster operation: Cannot delete protected Cluster, please disable deletion protection and try again.

您可以使用modify-db-clusterAWS CLI命令變更Aurora Serverless v1資料庫叢集的刪除保護設定,如下所示:

aws rds modify-db-cluster --db-cluster-identifier your-cluster-name --no-deletion-protection

此命令會傳回指定資料庫叢集的修訂屬性。您現在就可以刪除 Aurora Serverless v1 資料庫叢集。

我們建議您每當刪除 Aurora Serverless v1 資料庫叢集時,一律建立最終快照。下列使用範例AWS CLIdelete-db-cluster顯示如何操作。您可以提供資料庫叢集的名稱和快照的名稱。

對於LinuxmacOS、或Unix:

aws rds delete-db-cluster --db-cluster-identifier \ your-cluster-name --no-skip-final-snapshot \ --final-db-snapshot-identifier name-your-snapshot

在Windows中:

aws rds delete-db-cluster --db-cluster-identifier ^ your-cluster-name --no-skip-final-snapshot ^ --final-db-snapshot-identifier name-your-snapshot