对 RDS for SQL Server 实例启用 Microsoft SQL Server 资源调控器 - Amazon Relational Database Service
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

对 RDS for SQL Server 实例启用 Microsoft SQL Server 资源调控器

通过向 RDS for SQL Server 数据库实例添加 RESOURCE_GOVERNOR 选项,启用资源调控器。使用以下过程:

  1. 创建新的选项组或选择现有的选项组。

  2. RESOURCE_GOVERNOR 选项添加到该选项组。

  3. 将选项组与数据库实例相关联。

注意

通过选项组启用资源调控器不要求重启。

RESOURCE_GOVERNOR 创建选项组

要启用资源调控器,请创建或修改与您计划使用的 SQL Server 版本和数据库实例版本对应的选项组。要完成此过程,请使用 Amazon Web Services 管理控制台或 Amazon CLI。

使用以下过程创建适用于 SQL Server 企业版 2022 的选项组。

创建选项组
  1. 登录 Amazon Web Services 管理控制台 并通过以下网址打开 Amazon RDS 控制台:https://console.aws.amazon.com/rds/

  2. 在导航窗格中,选择选项组

  3. 选择创建组

  4. 创建选项组窗口中,执行以下操作:

    1. 对于名称,输入选项组的名称,该名称在 Amazon 账户内具有唯一性,例如 resource-governor-ee-2022。此名称只能包含字母、数字和连字符。

    2. 对于描述,输入选项组的简要描述,例如 RESOURCE_GOVERNOR option group for SQL Server EE 2022。此说明用于显示说明。

    3. 对于引擎,选择 sqlserver-ee

    4. 对于主引擎版本,选择 16.00

  5. 选择创建

以下过程创建适用于 SQL Server 企业版 2022 的选项组。

创建选项组
  • 运行以下命令之一。

    对于 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 选项添加到选项组

接下来,使用 Amazon Web Services 管理控制台或 Amazon CLI 将 RESOURCE_GOVERNOR 选项添加到您的选项组。

添加 RESOURCE_GOVERNOR 选项
  1. 登录 Amazon Web Services 管理控制台 并通过以下网址打开 Amazon RDS 控制台:https://console.aws.amazon.com/rds/

  2. 在导航窗格中,选择选项组

  3. 选择您刚创建的选项组(在此示例中为 resource-governor-ee-2022)。

  4. 选择添加选项

  5. 选项详细信息下,对于选项名称选择 RESOURCE_GOVERNOR

  6. 计划 (Scheduling) 下,选择是立即添加选项还是在下一个维护时段添加选项。

  7. 选择添加选项

添加 RESOURCE_GOVERNOR 选项。
  • RESOURCE_GOVERNOR 选项添加到该选项组。

    对于 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

将选项组与数据库实例关联

要将 RESOURCE_GOVERNOR 选项组与数据库实例关联,请使用 Amazon Web Services 管理控制台或 Amazon CLI。

要完成激活资源调控器,请将 RESOURCE_GOVERNOR 选项组与新的或现有的数据库实例关联:

可以将 RESOURCE_GOVERNOR 选项组与新的或现有的数据库实例关联。

使用 RESOURCE_GOVERNOR 选项组创建实例
  • 指定创建选项组时使用的相同数据库引擎类型和主要版本。

    对于 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 选项组
  • 运行以下命令之一。

    对于 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