Purpose
You can use this statement to modify a resource unit.
Syntax
ALTER RESOURCE UNIT unit_name
MAX_CPU [=] cpu_num,
MAX_MEMORY [=] mem_size,
MAX_IOPS [=] iops_num,
MAX_DISK_SIZE [=] disk_size,
MAX_SESSION_NUM [=] session_num,
[MIN_CPU [=] cpu_num,]
[MIN_MEMORY [=] mem_size,]
[MIN_IOPS [=] iops_num] ;
Parameters
| Parameter | Description |
|---|---|
| MAX_CPU | The maximum number of CPU cores of the resource unit. |
| MAX_MEMORY | The maximum memory size of the resource unit, in bytes. Value range: [1073741824, +∞). Default value: 5368709120, that is 5 GB. |
| MAX_IOPS | The maximum IOPS of the resource unit. Value range: [128, +∞). |
| MAX_DISK_SIZE | The maximum disk size of the resource unit, in bytes. Value range: [536870912, +∞). Minimum value: 512 MB. |
| MAX_SESSION_NUM | The maximum number of sessions of the resource unit. Value range: [64, +∞). |
| MIN_CPU | The minimum number of CPU cores of the resource unit. |
| MIN_MEMORY | The minimum memory size of the resource unit. |
| MIN_IOPS | The minimum IOPS of the resource unit. |
Examples
Change the maximum number of CPU cores to 2 and the maximum memory size to 5 GB for resource unit unit1.
obclient> ALTER RESOURCE UNIT unit1 MAX_CPU 2, MAX_MEMORY '5G';
Query OK, 0 rows affected (0.02 sec)