All Products
Search
Document Center

ALTER RESOURCE UNIT

Last Updated: Jun 18, 2021

Description

You can execute the ALTER RESOURCE UNIT statement to modify a resource unit.

Syntax

ALTER RESOURCE UNIT unitname 
  MAX_CPU [=] cpunum, 
  MAX_MEMORY [=] memsize, 
  MAX_IOPS [=] iopsnum, 
  MAX_DISK_SIZE [=] disksize, 
  MAX_SESSION_NUM [=] sessionnum, 
  [MIN_CPU [=] cpunum,]
  [MIN_MEMORY [=] memsize,] 
  [MIN_IOPS [=] iopsnum] ;

Parameters

Parameter

Description

MAX_CPU

The maximum number of CPUs.

MAX_MEMORY

The maximum memory size. Valid values: [1073741824,+∞). The unit is bytes. The minimum value 1073741824 bytes is equivalent to 1 GB.

MAX_IOPS

The maximum IOPS. Valid values: [128,+∞).

MAX_DISK_SIZE

The maximum disk capacity. Valid values: [536870912,+∞). The unit is bytes. The minimum value 536870912 bytes is equivalent to 512 MB.

MAX_SESSION_NUM

The maximum number of sessions. Valid values: [64,+∞).

MIN_CPU

The minimum number of CPUs.

MIN_MEMORY

The minimum memory size.

MIN_IOPS

The minimum IOPS.

Examples

  • Modify resource unit unit1 by changing the maximum number of CPUs to two and memory size to 2 GB.
OceanBase(admin@test)> ALTER RESOURCE UNIT unit1 max_cpu 2, max_memory '2G';
Query OK, 0 rows affected (0.02 sec)