

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

# 為您的 RDS for SQL Server 執行個體啟用 Microsoft SQL Server 資源長
<a name="ResourceGovernor.Enabling"></a>

將 `RESOURCE_GOVERNOR`選項新增至 RDS for SQL Server 資料庫執行個體，以啟用資源長。請使用下列程序：

1. 建立新的選項群組或選擇現有的選項群組。

1. 將 `RESOURCE_GOVERNOR` 選項新增至選項群組。

1. 將選項群組與資料庫執行個體建立關聯。

**注意**  
透過選項群組啟用資源長不需要重新啟動。

## 建立 `RESOURCE_GOVERNOR` 的選項群組
<a name="ResourceGovernor.OptionGroup"></a>

若要啟用資源協調人員，請建立選項群組或修改對應至 SQL Server 版本和您計劃使用的資料庫執行個體版本的選項群組。若要完成此程序，請使用 AWS 管理主控台 或 AWS CLI。

### 主控台
<a name="ResourceGovernor.OptionGroup.Console"></a>

使用下列程序建立 SQL Server Enterprise Edition 2022 的選項群組。

**建立選項群組**

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

1. 在導覽窗格中，選擇 **Option groups** (選項群組)。

1. 選擇**建立群組**。

1. 在 **Create option group (建立選項群組)** 視窗中，執行下列動作：

   1. 針對**名稱**，輸入您 AWS 帳戶中唯一的選項群組名稱，例如 **resource-governor-ee-2022**。名稱僅可包含字母、數字與連字號。

   1. 對於 **Description (描述)**，請輸入選項群組的簡短描述，例如 **RESOURCE\$1GOVERNOR option group for SQL Server EE 2022**。用於顯示用途的說明。

   1. 針對**引擎**，選擇 **sqlserver-ee**。

   1. 針對**主要引擎版本**，選擇 **16.00**。

1. 選擇**建立**。

### CLI
<a name="ResourceGovernor.OptionGroup.CLI"></a>

下列程序會建立 SQL Server Enterprise Edition 2022 的選項群組。

**建立選項群組**
+ 請執行下列其中一個命令：  
**Example**  

  針對 Linux、macOS 或 Unix：

  ```
  aws rds create-option-group \
      --option-group-name resource-governor-ee-2022 \
      --engine-name sqlserver-ee \
      --major-engine-version 16.00 \
      --option-group-description "RESOURCE_GOVERNOR option group for SQL Server EE 2022"
  ```

  在 Windows 中：

  ```
  aws rds create-option-group ^
      --option-group-name resource-governor-ee-2022 ^
      --engine-name sqlserver-ee ^
      --major-engine-version 16.00 ^
      --option-group-description "RESOURCE_GOVERNOR option group for SQL Server EE 2022"
  ```

## 將 `RESOURCE_GOVERNOR` 選項新增至選項群組
<a name="ResourceGovernor.Add"></a>

接著，使用 AWS 管理主控台 或 AWS CLI 將 `RESOURCE_GOVERNOR` 選項新增至您的選項群組。

### 主控台
<a name="ResourceGovernor.Add.Console"></a>

**新增 RESOURCE\$1GOVERNOR 選項**

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

1. 在導覽窗格中，選擇 **Option groups** (選項群組)。

1. 在此範例中，選擇您剛建立的選項群組 **resource-governor-ee-2022**。

1. 選擇 **Add option (新增選項)**。

1. 在**選項詳細資訊**下，選擇**選項名稱**的 **RESOURCE\$1GOVERNOR**。

1. 在 **Scheduling (排程)** 下，選擇要立即新增選項或是在下一個維護時段新增選項。

1. 選擇 **Add option (新增選項)**。

### CLI
<a name="ResourceGovernor.Add.CLI"></a>

**新增 `RESOURCE_GOVERNOR` 選項**
+ 將 `RESOURCE_GOVERNOR` 選項新增至選項群組。  
**Example**  

  針對 Linux、macOS 或 Unix：

  ```
  aws rds add-option-to-option-group \
      --option-group-name resource-governor-ee-2022 \
      --options "OptionName=RESOURCE_GOVERNOR" \
      --apply-immediately
  ```

  在 Windows 中：

  ```
  aws rds add-option-to-option-group ^
      --option-group-name resource-governor-ee-2022 ^
      --options "OptionName=RESOURCE_GOVERNOR" ^
      --apply-immediately
  ```

## 將選項群組關聯至您的資料庫執行個體
<a name="ResourceGovernor.Apply"></a>

若要將`RESOURCE_GOVERNOR`選項群組與您的資料庫執行個體建立關聯，請使用 AWS 管理主控台 或 AWS CLI。

### 主控台
<a name="ResourceGovernor.Apply.Console"></a>

若要完成啟用資源長，請將您的`RESOURCE_GOVERNOR`選項群組與新的或現有的資料庫執行個體建立關聯：
+ 對於新的資料庫執行個體，請在啟動執行個體時將它們相關聯。如需更多詳細資訊，請參閱 [建立 Amazon RDS 資料庫執行個體](USER_CreateDBInstance.md)。
+ 對於現有的資料庫執行個體，請透過修改執行個體來建立關聯。如需詳細資訊，請參閱[修改 Amazon RDS 資料庫執行個體](Overview.DBInstance.Modifying.md)。

### CLI
<a name="ResourceGovernor.Apply.CLI"></a>

您可以將`RESOURCE_GOVERNOR`選項群組與新的或現有的資料庫執行個體建立關聯。

**使用`RESOURCE_GOVERNOR`選項群組建立執行個體**
+ 指定建立選項群組時所使用的相同資料庫引擎類型和主要版本。  
**Example**  

  針對 Linux、macOS 或 Unix：

  ```
  aws rds create-db-instance \
      --db-instance-identifier mytestsqlserverresourcegovernorinstance \
      --db-instance-class db.m5.2xlarge \
      --engine sqlserver-ee \
      --engine-version 16.00 \
      --license-model license-included \
      --allocated-storage 100 \
      --master-username admin \
      --master-user-password password \
      --storage-type gp2 \
      --option-group-name resource-governor-ee-2022
  ```

  在 Windows 中：

  ```
  aws rds create-db-instance ^
      --db-instance-identifier mytestsqlserverresourcegovernorinstance ^
      --db-instance-class db.m5.2xlarge ^
      --engine sqlserver-ee ^
      --engine-version 16.00 ^
      --license-model license-included ^
      --allocated-storage 100 ^
      --master-username admin ^
      --master-user-password password ^
      --storage-type gp2 ^
      --option-group-name resource-governor-ee-2022
  ```

**修改執行個體並關聯 `RESOURCE_GOVERNOR` 選項群組**
+ 請執行下列其中一個命令：  
**Example**  

  針對 Linux、macOS 或 Unix：

  ```
  aws rds modify-db-instance \
      --db-instance-identifier mytestinstance \
      --option-group-name resource-governor-ee-2022 \
      --apply-immediately
  ```

  在 Windows 中：

  ```
  aws rds modify-db-instance ^
      --db-instance-identifier mytestinstance ^
      --option-group-name resource-governor-ee-2022 ^
      --apply-immediately
  ```