備份和還原 Aurora PostgreSQL 無限資料庫 - Amazon Aurora

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

備份和還原 Aurora PostgreSQL 無限資料庫

您可以備份和還原使用 Aurora PostgreSQL 無限資料庫的資料庫叢集。

備份使用 Aurora PostgreSQL 無限資料庫的資料庫叢集

與備份標準 Aurora 資料庫叢集相比,使用 Aurora PostgreSQL 無限制資料庫備份資料庫叢集的功能與 相似。

  • 當您取得使用無限資料庫的 Aurora 資料庫叢集的手動資料庫叢集快照時,快照會包含來自資料庫碎片群組的資料。

  • 連續備份包含來自資料庫碎片群組的資料。

  • 自動化的每日快照包含來自資料庫碎片群組的資料。

  • 支援複製資料庫叢集快照。如需詳細資訊,請參閱資料庫叢集快照複製

  • 支援共用資料庫叢集快照。如需詳細資訊,請參閱共享資料庫叢集快照

  • 您無法使用 pg_dumppg_dumpall公用程式來備份資料庫碎片群組中的資料庫。

  • Aurora PostgreSQL 無限資料庫支援在刪除資料庫叢集時擷取最終快照。

  • Aurora PostgreSQL 無限資料庫不支援在刪除資料庫叢集時保留自動備份。

建立資料庫叢集快照

建立 Aurora PostgreSQL 無限資料庫資料庫叢集快照的方式與建立標準 Aurora 資料庫叢集的方式相同,如下列 AWS CLI 範例所示:

aws rds create-db-cluster-snapshot \ --db-cluster-identifier my-db-cluster \ --db-cluster-snapshot-identifier my-db-cluster-snapshot

如需備份資料庫叢集的詳細資訊,請參閱備份與還原 Aurora 資料庫叢集的概觀

還原使用 Aurora PostgreSQL 無限資料庫的資料庫叢集

與還原標準 Aurora 資料庫叢集相比,使用 Aurora PostgreSQL 無限資料庫還原資料庫叢集在功能上具有相似性和差異。

  • 您只能從使用與無限資料庫相容的資料庫引擎版本的來源資料庫叢集還原無限資料庫資料庫叢集,例如 16.4-limitless

  • 當您從使用無限資料庫的資料庫叢集手動快照還原資料庫叢集時,會還原整個資料庫叢集儲存體。這包括資料庫碎片群組的儲存。

    您必須建立資料庫碎片群組,才能存取無限資料庫的儲存體。

  • 您可以使用復原 (PITR) 將資料庫叢集 point-in-time還原至保留期間內的任何點。還原的資料庫叢集包含資料庫碎片群組的儲存體。

    您必須建立資料庫碎片群組,才能存取無限資料庫的儲存體。

  • PITR 不支援已刪除的 Aurora PostgreSQL 無限資料庫資料庫叢集。

  • 當您從自動化每日快照還原資料庫叢集時,也會還原資料庫碎片群組的儲存體。

  • 當您還原 Aurora PostgreSQL 無限資料庫叢集時,您必須啟用增強型監控和效能洞見。請務必包含績效詳情KMS金鑰 ID。

在您還原 Aurora PostgreSQL 無限資料庫叢集之後,請務必在其中執行查詢,以驗證其功能。

從資料庫快照還原資料庫叢集

下列 AWS CLI 範例示範如何從資料庫叢集快照還原 Aurora PostgreSQL 無限制資料庫資料庫叢集。

您必須使用16.4-limitless資料庫引擎版本。

從資料庫叢集快照還原無限資料庫叢集
  1. 還原資料庫叢集:

    aws rds restore-db-cluster-from-snapshot \ --db-cluster-identifier my-new-db-cluster \ --snapshot-identifier my-db-cluster-snapshot \ --engine aurora-postgresql \ --engine-version 16.4-limitless \ --enable-performance-insights \ --performance-insights-retention-period 31 \ --performance-insights-kms-key-id arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab \ --monitoring-interval 5 \ --monitoring-role-arn arn:aws:iam::123456789012:role/EMrole
  2. 建立資料庫碎片群組:

    aws rds create-db-shard-group \ --db-cluster-identifier my-new-db-cluster \ --db-shard-group-identifier my-new-DB-shard-group \ --max-acu 1000

    如需詳細資訊,請參閱將資料庫碎片群組新增至現有的 Aurora PostgreSQL 無限制資料庫資料庫叢集

如需從資料庫叢集快照還原 Aurora 資料庫叢集的詳細資訊,請參閱從資料庫叢集快照還原

使用 point-in-time復原還原資料庫叢集

下列 AWS CLI 範例示範如何使用復原 () 還原 Aurora PostgreSQL 無限制資料庫資料庫叢集 point-in-timePITR。

使用 還原無限資料庫資料庫叢集 PITR
  1. 還原資料庫叢集:

    aws rds restore-db-cluster-to-point-in-time \ --source-db-cluster-identifier my-db-cluster \ --db-cluster-identifier my-new-db-cluster \ --use-latest-restorable-time \ --enable-performance-insights \ --performance-insights-retention-period 31 \ --performance-insights-kms-key-id arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab \ --monitoring-interval 5 \ --monitoring-role-arn arn:aws:iam::123456789012:role/EMrole
  2. 建立資料庫碎片群組:

    aws rds create-db-shard-group \ --db-cluster-identifier my-new-db-cluster \ --db-shard-group-identifier my-new-DB-shard-group \ --max-acu 1000

    如需詳細資訊,請參閱將資料庫碎片群組新增至現有的 Aurora PostgreSQL 無限制資料庫資料庫叢集

如需 PITR 的詳細資訊,請參閱將資料庫叢集還原至指定時間

不支援 PostgreSQL 備份和還原公用程式

主要資料庫叢集或資料庫碎片群組不支援下列 PostgreSQL 公用程式:

  • pg_dump

  • pg_dumpall

  • pg_restore

雖然您可能可以藉由開放原始碼二進位檔或其他方法使用它們,但這樣做可能會導致結果不一致。