從 Amazon RDS 的複寫備份還原至指定的時間 - Amazon Relational Database Service

從 Amazon RDS 的複寫備份還原至指定的時間

您可以使用 Amazon RDS 主控台從複寫備份將資料庫執行個體還原至特定的時間點。您也可以使用 restore-db-instance-to-point-in-time AWS CLI 命令或 RestoreDBInstanceToPointInTime RDS API 操作。

如需有關 point-in-time 恢復 (PITR) 的一般資訊,請參閱 將 Amazon RDS 的資料庫執行個體還原至指定時間

注意

跨 AWS 區域 複寫自動備份時,請注意下列資料庫引擎限制:

  • 在 RDS for SQL Server 上,不會複製選項群組。

  • 在 RDS for Oracle 上,不會複製下列選項:NATIVE_NETWORK_ENCRYPTIONOEMOEM_AGENTSSL

如果您已將自訂選項群組與 資料庫執行個體相關聯,則可以在目的地區域中重新建立該選項群組。然後還原目的地區域中的資料庫執行個體,並將自訂選項群組與其關聯。如需詳細資訊,請參閱 使用選項群組

從複寫備份將資料庫執行個體還原至指定的時間
  1. 登入 AWS Management Console,開啟位於 https://console.aws.amazon.com/rds/ 的 Amazon RDS 主控台。

  2. 從區域選取器中選擇目的地區域 (將備份複製到的位置)。

  3. 在導覽窗格中,選擇 Automated backups (自動備份)。

  4. Replicated backups (複寫備份) 標籤上,選擇要還原的資料庫執行個體。

  5. 針對 Actions (動作),選擇 Restore to point in time (還原至時間點)。

  6. 選擇 Latest restorable time (最近的可還原時間) 以還原最近一次的可能時間,或選擇 Custom (自訂) 以選擇一個時間。

    如果您選擇 Custom (自訂),請輸入您希望執行個體還原到什麼日期和時間。

    注意

    會以您的當地時區顯示時間,根據國際標準時間 (UTC) 的時差來表示。例如,UTC-5 是東部標準時間/中部日光節約時間。

  7. 對於 DB Instance Identifier (資料庫執行個體識別符),輸入目標還原資料庫執行個體的名稱。

  8. (選用) 視需要選擇其他選項,例如啟用自動調整規模。

  9. 選擇 Restore to point in time (還原至時間點)

使用 restore-db-instance-to-point-in-time AWS CLI 命令建立新的資料庫執行個體。

從複寫備份將資料庫執行個體還原至指定的時間
  • 請執行下列其中一個命令:

    對於 Linux、macOS 或 Unix:

    aws rds restore-db-instance-to-point-in-time \ --source-db-instance-automated-backups-arn "arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE" \ --target-db-instance-identifier mytargetdbinstance \ --restore-time 2020-10-14T23:45:00.000Z

    在 Windows 中:

    aws rds restore-db-instance-to-point-in-time ^ --source-db-instance-automated-backups-arn "arn:aws:rds:us-east-1:123456789012:auto-backup:ab-L2IJCEXJP7XQ7HOJ4SIEXAMPLE" ^ --target-db-instance-identifier mytargetdbinstance ^ --restore-time 2020-10-14T23:45:00.000Z

若要將資料庫執行個體還原至指定的時間,請搭配下列參數呼叫 RestoreDBInstanceToPointInTime Amazon RDS API 操作:

  • SourceDBInstanceAutomatedBackupsArn

  • TargetDBInstanceIdentifier

  • RestoreTime