Purpose
You can use the ALTER RESOURCE POOL statement to modify the attributes of a resource pool, including the UNIT, UNIT_NUM, and ZONE_LIST attributes.
Limitations and considerations
You can use the
ALTER RESOURCE POOLstatement to modify only one attribute of a resource pool at a time. To modify two or all of theUNIT,UNIT_NUM, andZONE_LISTattributes, execute the statement repeatedly.To modify the
UNIT_NUMattribute of a resource pool that has been allocated to a tenant, you must use theALTER RESOURCE TENANTstatement instead of theALTER RESOURCE POOLstatement. For more information about theALTER RESOURCE TENANTstatement, see ALTER RESOURCE TENANT.
Required privileges
Only the root user of the sys tenant (namely the root@sys user) can execute this statement.
Syntax
ALTER RESOURCE POOL
ALTER RESOURCE POOL pool_name
UNIT [=] unit_name
| UNIT_NUM [=] unit_num [DELETE UNIT = (unit_id_list)]
| ZONE_LIST [=] ('zone_name' [, 'zone_name' ...]);
Parameters
| Parameter | Description |
|---|---|
| unit_name | The name of the unit config for the resource pool. |
| unit_num | The number of resource units in a single zone. If you want to increase the value of unit_num, make sure that the parameter value is less than or equal to the number of OBServer nodes in the target zone. |
| unit_id_list | The list of IDs of resource units to be deleted. When you decrease the value of unit_num, you can use the DELETE UNIT keyword to specify the resource units to be deleted. If you do not specify DELETE UNIT, the system will randomly delete the corresponding number of resource units.
NoticeWhen you use the
|
| ZONE_LIST | The list of zones for the resource pool after modification. |
Examples
You can modify only one attribute of resource pool
pool1at a time. For example, the following statement attempts to modify theUNIT,UNIT_NUM, andZONE_LISTattributes at a time, and an error will occur during its execution.obclient [oceanbase]> ALTER RESOURCE POOL pool1 UNIT='unit2', UNIT_NUM=1, ZONE_LIST=('zone1'); ERROR 1235 (0A000): alter unit_num, resource_unit, zone_list in one cmd not supportedWhen you decrease the value of
UNIT_NUM, you can specify the resource units to be deleted.obclient [oceanbase]> ALTER RESOURCE POOL pool1 UNIT_NUM=1 DELETE UNIT = (1002);Change the unit config for the resource pool
pool1tounit2.obclient [oceanbase]> ALTER RESOURCE POOL pool1 UNIT='unit2';