

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

# 從 RDS Custom for Oracle 資料庫快照還原
<a name="custom-backup.restoring"></a>

**注意**  
終止支援通知：2027 年 3 月 31 日， AWS 將終止對 Amazon RDS Custom for Oracle 的支援。2027 年 3 月 31 日之後，您將無法再存取 RDS Custom for Oracle 主控台或 RDS Custom for Oracle 資源。如需詳細資訊，請參閱[RDS Custom for Oracle 終止支援](RDS-Custom-for-Oracle-end-of-support.md)。

還原 RDS Custom for Oracle 資料庫執行個體時，您要提供資料庫快照的名稱和新執行個體的名稱。您無法從快照還原至現有的 RDS Custom 資料庫執行個體。還原時，會建立新的 RDS Custom for Oracle 資料庫執行個體。

還原程序與在 Amazon RDS 中還原的方式有以下不同：
+ 還原快照之前，RDS Custom for Oracle 會先備份現有的組態檔案。這些檔案可以在目錄 `/rdsdbdata/config/backup` 中的還原執行個體上取得。RDS Custom for Oracle 會使用預設參數還原資料庫快照，並使用現有的資料庫組態檔案覆寫先前的資料庫組態檔案。因此，還原的執行個體不會保留自訂參數和對資料庫組態檔案的變更。
+ 還原的資料庫名稱與快照中的名稱相同。您無法指定不同的名稱。(對於 RDS Custom for Oracle，預設值為 `ORCL`。)

## 主控台
<a name="custom-backup.restoring.console"></a>

**若要從資料庫快照還原 RDS Custom 資料庫執行個體**

1. 登入 AWS 管理主控台 並開啟位於 https：//[https://console.aws.amazon.com/rds/](https://console.aws.amazon.com/rds/) 的 Amazon RDS 主控台。

1. 在導覽窗格中，選擇 **Snapshots (快照)**。

1. 選擇想要從中還原的資料庫執行個體。

1. 針對 **Actions** (動作)，選擇 **Restore snapshot** (還原快照)。

1. 在 **Restore DB Instance** (還原資料庫執行個體) 頁面上，針對 **DB Instance Identifier (資料庫執行個體識別符)**，輸入您還原的 RDS Custom 資料庫執行個體的名稱。

1. 選擇 **Restore DB instance** (還原資料庫執行個體)。

## AWS CLI
<a name="custom-backup.restoring.CLI"></a>

您可以使用 [ restore-db-instance-from-db-snapshot ](https://docs.aws.amazon.com/cli/latest/reference/rds/restore-db-instance-from-db-snapshot.html) AWS CLI 命令還原 RDS Custom 資料庫快照。

如果您要從中還原的快照適用於私有資料庫執行個體，請務必指定正確的 `db-subnet-group-name` 和 `no-publicly-accessible`。否則，資料庫執行個體預設為可公開存取。下列選項是必要的：
+ `db-snapshot-identifier` – 識別要從中進行還原的快照
+ `db-instance-identifier` – 指定要從資料庫快照建立之 RDS Custom 資料庫執行個體的名稱
+ `custom-iam-instance-profile` – 指定與 RDS Custom 資料庫執行個體的基礎 Amazon EC2 執行個體關聯的執行個體設定檔。

下列程式碼會為 `my-custom-instance` 還原名稱為 `my-custom-snapshot` 的快照。

**Example**  
在 Linux、macOS 或 Unix 中：  

```
aws rds restore-db-instance-from-db-snapshot \
  --db-snapshot-identifier {{my-custom-snapshot}} \
  --db-instance-identifier {{my-custom-instance}} \
  --custom-iam-instance-profile {{AWSRDSCustomInstanceProfileForRdsCustomInstance}} \
  --no-publicly-accessible
```
在 Windows 中：  

```
aws rds restore-db-instance-from-db-snapshot ^
  --db-snapshot-identifier {{my-custom-snapshot}} ^
  --db-instance-identifier {{my-custom-instance}} ^
  --custom-iam-instance-profile {{AWSRDSCustomInstanceProfileForRdsCustomInstance}} ^
  --no-publicly-accessible
```