

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

# 從多可用區域資料庫叢集快照還原至資料庫執行個體
<a name="USER_RestoreFromMultiAZDBClusterSnapshot"></a>

*多可用區域資料庫叢集快照*是資料庫叢集的儲存體磁碟區快照，其會備份整個資料庫叢集，而不只是個別的資料庫。您可以將多可用區域資料庫叢集快照還原至單一可用區域部署或多可用區資料庫執行個體部署。如需多可用區域部署的相關資訊，請參閱 [設定及管理 Amazon RDS 的多可用區域部署](Concepts.MultiAZ.md)。

**注意**  
您也可以將多可用區域資料庫叢集快照還原至新的多可用區域資料庫叢集。如需說明，請參閱[從快照還原至多可用區域資料庫叢集](USER_RestoreFromMultiAZDBClusterSnapshot.Restoring.md)。

如需使用 RDS 延長支援版本還原多可用區域資料庫叢集的詳細資訊，請參閱 [使用 Amazon RDS 延伸支援還原資料庫執行個體或多可用區域資料庫叢集](extended-support-restoring-db-instance.md)。

使用 AWS CLI、 AWS 管理主控台或 RDS API 將多可用區域資料庫叢集快照還原至單一可用區域部署或多可用區域資料庫執行個體部署。

## 主控台
<a name="USER_RestoreFromMultiAZDBClusterSnapshot.CON"></a>

**將多可用區域資料庫叢集快照還原至單一可用區域部署或多可用區資料庫執行個體部署**

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

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

1. 選擇想要從中還原的多可用區域資料庫叢集快照。

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

1. 在 **Restore snapshot** (還原快照) 頁面的 **Availability and durability** (可用性和持久性) 中，選擇下列其中一項：
   + **Single DB instance** (單一資料庫執行個體) - 將快照還原到沒有待命資料庫執行個體的資料庫執行個體。
   + **Multi-AZ DB instance** (多可用區域資料庫執行個體) - 將快照還原至具有一個主要資料庫執行個體和一個待命資料庫執行個體的多可用區域資料庫執行個體部署。

1. 對於 **DB instance identifier** (資料庫執行個體識別符)，輸入所還原資料庫執行個體的名稱。

1. 在其餘區段，指定資料庫執行個體的設定。如需每項設定的相關資訊，請參閱 [資料庫執行個體的設定](USER_CreateDBInstance.Settings.md)。

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

## AWS CLI
<a name="USER_RestoreFromMultiAZDBClusterSnapshot.CLI"></a>

若要將多可用區域資料庫叢集快照還原至資料庫執行個體部署，請使用 AWS CLI 命令 [restore-db-instance-from-db-snapshot](https://docs.aws.amazon.com/cli/latest/reference/rds/restore-db-instance-from-db-snapshot.html)。

在下列範例中，您會從先前建立的多可用區域資料庫叢集快照 (名為 `myclustersnapshot`) 還原。您會還原至主要資料庫執行個體名為 `mynewdbinstance` 的新多可用區域資料庫執行個體部署。對於 `--db-cluster-snapshot-identifier` 選項，指定多可用區域資料庫叢集快照的名稱。

對於 `--db-instance-class` 選項，指定資料庫執行個體類別，進行新的資料庫執行個體部署。如需資料庫執行個體類別的詳細資訊，請參閱 [ 資料庫執行個體類別](Concepts.DBInstanceClass.md)。

您也可以指定其他選項。

**Example**  
針對 Linux、macOS 或 Unix：  

```
1. aws rds restore-db-instance-from-db-snapshot \
2.     --db-instance-identifier mynewdbinstance \
3.     --db-cluster-snapshot-identifier myclustersnapshot \
4.     --engine mysql \
5.     --multi-az \
6.     --db-instance-class db.r6g.xlarge
```
在 Windows 中：  

```
1. aws rds restore-db-instance-from-db-snapshot ^
2.     --db-instance-identifier mynewdbinstance ^
3.     --db-cluster-snapshot-identifier myclustersnapshot ^
4.     --engine mysql ^
5.     --multi-az ^
6.     --db-instance-class db.r6g.xlarge
```

在還原資料庫執行個體之後，您可以將其集新增至安全群組，此安全群組與您用來建立快照 (如果適用) 的多可用區域資料庫叢集相關聯。完成此動作會提供先前多可用區域資料庫叢集的相同功能。

## RDS API
<a name="USER_RestoreFromMultiAZDBClusterSnapshot.API"></a>

若要將多可用區域資料庫叢集快照還原至資料庫執行個體部署，請呼叫 RDS API 操作 [RestoreDBInstanceFromDBSnapshot](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_RestoreDBInstanceFromDBSnapshot.html) 搭配下列參數：
+ `DBInstanceIdentifier` 
+ `DBClusterSnapshotIdentifier` 
+ `Engine` 

您也可以指定選用參數。

在還原資料庫執行個體之後，您可以將其集新增至安全群組，此安全群組與您用來建立快照 (如果適用) 的多可用區域資料庫叢集相關聯。完成此動作會提供先前多可用區域資料庫叢集的相同功能。