

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

# 建立資料庫叢集快照
<a name="USER_CreateSnapshotCluster"></a><a name="create_snapshot"></a>

Amazon RDS 會建立資料庫叢集的儲存體磁碟區快照，因此會備份整個資料庫叢集，而不只是個別的資料庫。建立資料庫叢集快照時，您必須找出要進行備份的資料庫叢集，並為該資料庫叢集快照命名，以便您稍後可透過它進行還原。建立資料庫叢集快照所需的時間長短隨資料庫的大小而異。由於快照包括整個儲存體磁碟區，檔案大小，例如暫存檔案，也會影響建立快照所需的時間量。

**注意**  
您的資料庫叢集必須處於 `available` 狀態，才能取得資料庫叢集快照。

與自動備份不同，手動快照不受備份保留期限的限制。快照不會過期。

針對非常長期的備份，建議您將快照資料匯出至 Amazon S3。如果資料庫引擎的主要版本不再受到支援，您則無法從快照還原至該版本。如需詳細資訊，請參閱[將資料庫叢集快照資料匯出至 Amazon S3](aurora-export-snapshot.md)。

您可以使用 AWS CLI、 或 RDS API AWS 管理主控台建立資料庫叢集快照。

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

**建立資料庫叢集快照**

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

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

   **手動快照**清單即會出現。

1. 選擇 **Take Snapshot** (擷取快照)。

   **Take DB Snapshot** (建立資料庫快照) 視窗隨即顯示。

1. 對於**快照類型**，選取**資料庫叢集**。  
![\[擷取資料庫快照。\]](http://docs.aws.amazon.com/zh_tw/AmazonRDS/latest/AuroraUserGuide/images/take_db_cluster_snapshot.png)

1. 選擇您要擷取快照的**資料庫叢集**。

1. 輸入**快照名稱**。

1. 選擇 **Take Snapshot** (擷取快照)。

   **手動快照**清單隨即顯示，且新的資料庫叢集快照的狀態顯示為 `Creating`。之後，其狀態為 `Available`，你可以看到其建立時間。

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

當您使用 建立資料庫叢集快照時AWS CLI，您需要識別您要備份的資料庫叢集，然後為資料庫叢集快照命名，以便稍後可以從中還原。您可以使用 AWS CLI[https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-cluster-snapshot.html](https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-cluster-snapshot.html)命令搭配下列參數來執行此操作：
+ `--db-cluster-identifier`
+ `--db-cluster-snapshot-identifier`

在此範例中，您會為 *mydbsnapshot* 資料庫叢集建立名為 *mydbsnapshot* 的資料庫叢集快照。

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

```
1. aws rds create-db-cluster-snapshot \
2.     --db-cluster-identifier mydbcluster \
3.     --db-cluster-snapshot-identifier mydbclustersnapshot
```
在 Windows 中：  

```
1. aws rds create-db-cluster-snapshot ^
2.     --db-cluster-identifier mydbcluster ^
3.     --db-cluster-snapshot-identifier mydbclustersnapshot
```

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

使用 Amazon RDS API 建立資料庫叢集快照時，您必須找出要進行備份的資料庫叢集，並為該資料庫叢集快照命名，以便您稍後可透過它進行還原。您可以使用 Amazon RDS API [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBClusterSnapshot.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBClusterSnapshot.html) 命令，並搭配下列參數來執行此動作：
+ DBClusterIdentifier
+ DBClusterSnapshotIdentifier

## 判斷資料庫叢集快照是否可用
<a name="USER_CreateSnapshotCluster.Available"></a>

您可以查看 中叢集詳細資訊頁面上**維護與備份**索引標籤的**快照**、AWS 管理主控台使用 CLI [https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-cluster-snapshots](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-cluster-snapshots) 命令或使用 [https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBClusterSnapshots.html](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DescribeDBClusterSnapshots.html) API 動作，來檢查資料庫叢集快照是否可用。

您也可以使用 [https://docs.aws.amazon.com/cli/latest/reference/rds/wait/db-cluster-snapshot-available.html](https://docs.aws.amazon.com/cli/latest/reference/rds/wait/db-cluster-snapshot-available.html) CLI 命令每隔 30 秒輪詢 API，直到快照可用為止。