

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

# 還原 Aurora Serverless v1 資料庫叢集
<a name="aurora-serverless.restorefromsnapshot"></a>

**重要**  
AWS 已[宣布 Aurora Serverless v1 的終止服務日期：2025 年 3 月 31 日](https://repost.aws/questions/QUhcMVoChXRm2HLi8F-yih1g/announcement-support-for-aurora-s/announcement-support-for-aurora-serverless-v1-ending-soon)。所有未在 2025 年 3 月 31 日之前遷移的 Aurora Serverless v1 叢集都會在維護時段期間遷移至 Aurora Serverless v2。如果升級失敗，Amazon Aurora 會在維護時段將 Serverless v1 叢集轉換為具有同等引擎版本的佈建叢集。如果適用，Amazon Aurora 將在 Amazon RDS 延長支援中註冊轉換後的已佈建叢集。如需更多詳細資訊，請參閱 [使用 Amazon Aurora 的 Amazon RDS 延伸支援](extended-support.md)。

 當您透過 AWS CLI 或 RDS API 還原佈建的資料庫叢集快照時，您可設定 Aurora Serverless v1 資料庫叢集。

 在您將快照還原至 Aurora Serverless v1 資料庫叢集時，您可以設定以下指定值：
+  **Minimum Aurora capacity unit (最小 Aurora 容量單位)** – Aurora Serverless v1 可將容量降低至此容量單位下限。
+  **Maximum Aurora capacity unit (最大 Aurora 容量單位)** – Aurora Serverless v1 可將容量提升至此容量單位上限。
+  **Timeout action** (逾時動作) – 當容量修改因找不到擴展點而逾時時，所要採取的動作。Aurora Serverless v1如果設定為 **Force scaling the capacity to the specified values...** (強制將容量擴展為指定的值...) 選項，則資料庫叢集可以強制將資料庫叢集設定為新的容量設定。或者，如果您沒有選擇此選項，它可以復原容量變更以取消容量變更。如需更多詳細資訊，請參閱 [容量變更時的逾時動作](aurora-serverless-v1.how-it-works.md#aurora-serverless.how-it-works.timeout-action)。
+  **Pause after inactivity (在無動作後暫停)** – 資料庫經過多久時間沒有流量後，將處理容量縮減為零。當資料庫流量恢復，Aurora 會自動恢復處理容量，並調整規模以應付流量。

 如需從快照還原資料庫叢集的一般資訊，請參閱 [從資料庫叢集快照還原](aurora-restore-snapshot.md)。

## AWS CLI
<a name="aurora-serverless.restorefromsnapshot.cli"></a>

當您透過 Aurora Serverless、AWS 管理主控台 或 RDS API 還原佈建的資料庫叢集快照時，您可設定 AWS CLI 資料庫叢集。

在您將快照還原至 Aurora Serverless 資料庫叢集時，您可以設定以下指定值：
+ **Minimum Aurora capacity unit (最小 Aurora 容量單位)** – Aurora Serverless 可將容量降低至此容量單位下限。
+ **Maximum Aurora capacity unit (最大 Aurora 容量單位)** – Aurora Serverless 可將容量提升至此容量單位上限。
+ **Timeout action** (逾時動作) – 當容量修改因找不到擴展點而逾時時，所要採取的動作。Aurora Serverless v1如果設定為 **Force scaling the capacity to the specified values...** (強制將容量擴展為指定的值...) 選項，則資料庫叢集可以強制將資料庫叢集設定為新的容量設定。或者，如果您沒有選擇此選項，它可以復原容量變更以取消容量變更。如需更多詳細資訊，請參閱 [容量變更時的逾時動作](aurora-serverless-v1.how-it-works.md#aurora-serverless.how-it-works.timeout-action)。
+ **Pause after inactivity (在無動作後暫停)** – 資料庫經過多久時間沒有流量後，將處理容量縮減為零。當資料庫流量恢復，Aurora 會自動恢復處理容量，並調整規模以應付流量。

**注意**  
資料庫叢集快照的版本必須與 Aurora Serverless v1 相容。如需支援版本的清單，請參閱 [Aurora Serverless v1](Concepts.Aurora_Fea_Regions_DB-eng.Feature.ServerlessV1.md)。

 若要將快照還原至與 MySQL 5.7 相容的 Aurora Serverless v1 叢集，請包含下列其他參數：
+  `--engine aurora-mysql` 
+  `--engine-version 5.7` 

 `--engine` 和 `--engine-version` 參數可讓您從與 MySQL 5.6 相容的 Aurora 或 Aurora Serverless v1 快照，建立與 MySQL 5.7 相容的 Aurora Serverless v1 叢集。以下範例會將快照從名為 *mydbclustersnapshot* 的 MySQL 5.6 相容叢集，還原至名為 *mynewdbcluster* 的 MySQL 5.7 相容 Aurora Serverless v1 叢集。

對於 Linux、macOS 或 Unix：

```
aws rds restore-db-cluster-from-snapshot \
    --db-cluster-identifier mynewdbcluster \
    --snapshot-identifier mydbclustersnapshot \
    --engine-mode serverless \
    --engine aurora-mysql \
    --engine-version 5.7
```

在 Windows 中：

```
aws rds restore-db-cluster-from-snapshot ^
    --db-instance-identifier mynewdbcluster ^
    --db-snapshot-identifier mydbclustersnapshot ^
    --engine aurora-mysql ^
    --engine-version 5.7
```

 您可以選擇指定 `--scaling-configuration` 選項以設定最小容量、最大容量，並在沒有連線時自動暫停。有效容量值包括：
+  Aurora MySQL：`1`、`2`、`4`、`8`、`16`、`32`、`64`、`128` 和 `256`。
+  Aurora PostgreSQL：`2`、`4`、`8`、`16`、`32`、`64`、`192` 和 `384`。

 在以下範例中，您會從先前建立的資料庫叢集快照 (名為 *mydbclustersnapshot*) 還原至名為 *mynewdbcluster* 的新資料庫叢集。您可以設定 `--scaling-configuration`，以便新的 Aurora Serverless v1 資料庫叢集可視需要從 8 個 ACU 擴展到 64 個 ACU (Aurora 容量單位)，以處理工作負載。處理完成後，在 1000 秒後沒有連線支援的情況下，叢集會關閉，直到連線請求提示重新啟動為止。

對於 Linux、macOS 或 Unix：

```
aws rds restore-db-cluster-from-snapshot \
    --db-cluster-identifier mynewdbcluster \
    --snapshot-identifier mydbclustersnapshot \
    --engine-mode serverless --scaling-configuration MinCapacity=8,MaxCapacity=64,TimeoutAction='ForceApplyCapacityChange',SecondsUntilAutoPause=1000,AutoPause=true
```

在 Windows 中：

```
aws rds restore-db-cluster-from-snapshot ^
    --db-instance-identifier mynewdbcluster ^
    --db-snapshot-identifier mydbclustersnapshot ^
    --engine-mode serverless --scaling-configuration MinCapacity=8,MaxCapacity=64,TimeoutAction='ForceApplyCapacityChange',SecondsUntilAutoPause=1000,AutoPause=true
```

## RDS API
<a name="aurora-serverless.restorefromsnapshot.api"></a>

 若要使用 RDS API，在您從資料庫叢集進行還原時設定 Aurora Serverless v1 資料庫叢集，請執行 [RestoreDBClusterFromSnapshot](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_RestoreDBClusterFromSnapshot.html) 操作，並為 `serverless` 參數指定 `EngineMode`。

 您可選擇指定 `ScalingConfiguration` 參數以設定最小容量、最大容量，並在沒有連線時自動暫停。有效容量值包括：
+  Aurora MySQL：`1`、`2`、`4`、`8`、`16`、`32`、`64`、`128` 和 `256`。
+  Aurora PostgreSQL：`2`、`4`、`8`、`16`、`32`、`64`、`192` 和 `384`。