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
When you use the
ALTER RESOURCE POOLstatement to modify the attributes of a resource pool, you can modify only one attribute at a time. If you want to modify two or more attributes, execute the statement repeatedly.If you want 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
You can modify the attributes of a tenant only as the root user of the sys tenant (namely root@sys).
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 unit config used by the resource pool. |
| unit_num | The number of units in a single zone after modification. When you increase the value of unit_num, make sure that the value is smaller than or equal to the number of nodes in the target zone. |
| unit_id_list | When you decrease the value of unit_num, you can use the DELETE UNIT clause to specify the IDs of the units to be deleted. If you do not use the DELETE UNIT clause, the system randomly deletes a corresponding number of units.
NoticeWhen you use
|
| 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 delete specified units.obclient [oceanbase]> ALTER RESOURCE POOL pool1 UNIT_NUM=1 DELETE UNIT = (1002);Change the unit config of the resource pool
pool1tounit2.obclient [oceanbase]> ALTER RESOURCE POOL pool1 UNIT='unit2';