You can drop a resource unit that is no longer in use.
Prerequisites
Before you drop a resource unit, make sure that the resource unit is not in use. If the resource unit is being used by a tenant, remove it from the resource pool of the tenant before dropping it.
Drop a resource unit by using an SQL statement
Dropping a resource unit mainly involves the following two scenarios:
The resource unit is not in use.
If the resource unit is not allocated to a resource pool, you can directly drop the resource unit. Sample statement:
obclient> DROP RESOURCE UNIT unit1;Notice
This statement drops only a single resource unit at a time.
The resource unit is in use.
If the resource unit has been allocated to a resource pool, you must specify a new resource unit for the resource pool before you drop the resource unit.
Here is an example:
Assume that
unit1is to be dropped andunit1has been allocated topool1. If you want to removeunit1, you must createunit2and allocate it topool1before you dropunit1.obclient> CREATE RESOURCE UNIT unit2 MAX_CPU 4, MAX_MEMORY '5G', MAX_IOPS 128,MAX_DISK_SIZE '10G', MAX_SESSION_NUM 64, MIN_CPU=4, MIN_MEMORY= '5G', MIN_IOPS=128; obclient> ALTER RESOURCE POOL pool1 UNIT='unit2'; obclient> DROP RESOURCE UNIT unit1;
Drop custom unit specifications in OCP
You can define unit specifications for resource units and drop custom unit specifications as needed. However, default unit specifications in OceanBase Cloud Platform (OCP) cannot be deleted.
Log on to the OCP console.
In the left-side navigation pane, click Tenants.
On the page that appears, click Unit Specification Management in the upper-right corner. The Unit Specification Management page appears.
Find the custom unit specifications to be dropped and click Delete in the Actions column.