Purpose
The ALTER RESOURCE POOL statement is used to modify the attributes of a resource pool, including UNIT, UNIT_NUM, and ZONE_LIST.
Limitations and considerations
When using the
ALTER RESOURCE POOLstatement to modify resource pool attributes, each statement only supports modifying one attribute at a time. If you need to modify two or more attributes amongUNIT,UNIT_NUM, andZONE_LISTsimultaneously, you must execute multiple statements.The current version of OceanBase AI Database supports both homogeneous zone mode and heterogeneous zone mode for tenants. In homogeneous zone mode, the number of units in each zone of a tenant must be the same. In heterogeneous zone mode, the number of units in each zone of a tenant can be different, but a tenant is limited to at most two
unit_numvalues. When increasing or decreasingUNIT_NUM:In heterogeneous zone mode, you can use the
ALTER RESOURCE POOLstatement to increase or decreaseUNIT_NUM, regardless of whether the resource pool is allocated to a tenant.Notice
Typically, for existing tenants or tenants upgraded from earlier versions, the default deployment mode is Homogeneous Zone Mode. To enable Heterogeneous Zone Mode, you must set the value of the
zone_deploy_modeparameter tohetero. After modification, it is not possible to change it back tohomo.In homogeneous zone mode, if a resource pool has already been allocated to a tenant, you cannot use the
ALTER RESOURCE POOLstatement. Instead, you must use theALTER RESOURCE TENANTstatement for modification. For more information about theALTER RESOURCE TENANTstatement, see ALTER RESOURCE TENANT.
Privilege requirements
Only the root user of the sys tenant (root@sys) can modify resource pools. Other tenants do not support this operation.
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
Parameters |
Description |
|---|---|
| unit_name | Specifies the name of the unit config to be used for modifying the resource pool. |
| unit_num | Specifies the number of units in a single zone after modification. Increase unit_num must be less than or equal to the number of nodes in the target zone. <main id="notice" type=notice'>NoticeIn heterogeneous zone mode, when you increase or decrease For example, if a tenant has three resource pools |
| DELETE UNIT | When you decrease unit_num, you can use DELETE UNIT to delete a specified unit. If DELETE UNIT is not specified, the system randomly deletes the specified number of units. <main id="notice" type=notice'>NoticeWhen using
|
| ZONE_LIST | Specifies the list of zones for the modified resource pool. |
Examples
You cannot modify multiple attributes of the resource pool
pool1at the same time. For example, the following statement attempts to modify theUNIT,UNIT_NUM, andZONEattributes simultaneously, which will result in an error.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 supportedSpecifically, when reducing
UNIT_NUM, you can delete specified units.obclient [oceanbase]> ALTER RESOURCE POOL pool1 UNIT_NUM=1 DELETE UNIT = (1002);Change the unit of resource pool
pool1tounit2.obclient [oceanbase]> ALTER RESOURCE POOL pool1 UNIT='unit2';
References
Modify the attributes of a resource pool