13.7.2.1 ALTER RESOURCE GROUP Statement语句

ALTER RESOURCE GROUP group_name
    [VCPU [=] vcpu_spec [, vcpu_spec] ...]
    [THREAD_PRIORITY [=] N]
    [ENABLE|DISABLE [FORCE]]
vcpu_spec: {N | M - N}

ALTER RESOURCE GROUP is used for resource group management (see Section 5.1.16, “Resource Groups”). ALTER RESOURCE GROUP用于资源组管理(见第5.1.16节,“资源组”)。This statement alters modifiable attributes of an existing resource group. 此语句更改现有资源组的可修改属性。It requires the RESOURCE_GROUP_ADMIN privilege.它需要RESOURCE_GROUP_ADMIN权限。

group_name identifies which resource group to alter. 标识要更改的资源组。If the group does not exist, an error occurs.如果该组不存在,则会发生错误。

The attributes for CPU affinity, priority, and whether the group is enabled can be modified with ALTER RESOURCE GROUP. CPU相关性、优先级以及组是否已启用的属性可以使用ALTER RESOURCE GROUP进行修改。These attributes are specified the same way as described for CREATE RESOURCE GROUP (see Section 13.7.2.2, “CREATE RESOURCE GROUP Statement”). 这些属性的指定方式与CREATE RESOURCE GROUP相同(请参阅第13.7.2.2节,“CREATE RESOURCE GROUP语句”)。Only the attributes specified are altered. 只更改指定的属性。Unspecified attributes retain their current values.未指定的属性保留其当前值

The FORCE modifier is used with DISABLE. FORCE修饰符与DISABLE一起使用。It determines statement behavior if the resource group has any threads assigned to it:如果资源组有任何线程分配给它,它将确定语句行为:

The name and type attributes are set at group creation time and cannot be modified thereafter with ALTER RESOURCE GROUP.名称和类型属性是在组创建时设置的,之后不能使用ALTER RESOURCE GROUP进行修改。

Examples:例如:

Resource group management is local to the server on which it occurs. 资源组管理是发生在其上的服务器的本地管理。ALTER RESOURCE GROUP statements are not written to the binary log and are not replicated.ALTER RESOURCE GROUP语句不会写入二进制日志,也不会被复制。