This topic describes how to drop a resource pool.
Prerequisites
Before you drop a resource pool, make sure that the resource pool is not being used by any tenant. To drop a resource pool being used by a tenant, release the resource pool first and then drop it.
If a tenant has multiple resource pools, you can modify the resource pool configuration of the tenant to drop a resource pool from the tenant. For more information, see Modify attributes of a tenant.
If a tenant has only one resource pool, you cannot directly drop it.
- Create a resource pool and allocate it to this tenant. Then, modify the resource pool configuration of the tenant to release the resource pool to be dropped. For more information about how to create a resource pool, see the Create a resource pool section in the Create a tenant topic.
- If the tenant is no longer needed, you can drop the tenant first and then drop the resource pool. For more information, see Drop a tenant.
Procedure
Log on to the sys tenant of the cluster as the root user.
obclient -h172.30.xx.xx -P2883 -uroot@sys#cluster -p**** -AExecute the following statement to go to the database named
oceanbase:obclient [(none)]> USE oceanbase;Query the
DBA_OB_RESOURCE_POOLSview for the configuration information about resource pools. If the value ofTENANT_IDof a resource pool is NULL, the resource pool is not allocated to any tenant and can be dropped.To query the configuration information about the resource pool named
mq_pool_02, execute the following statement:obclient [oceanbase]> SELECT TENANT_ID,NAME FROM DBA_OB_RESOURCE_POOLS WHERE NAME = 'mq_pool_02'; +-----------+------------+ | tenant_id | name | +-----------+------------+ | NULL | mq_pool_02 | +-----------+------------+ 1 row in setFor more information about the
DBA_OB_RESOURCE_POOLSview, see oceanbase.DBA_OB_RESOURCE_POOLS.Execute the
DROP RESOURCE POOLstatement to drop a resource pool.To drop the resource pool named
mq_pool_02, execute the following statement:obclient [oceanbase]> DROP RESOURCE POOL mq_pool_02; Query OK, 0 rows affectedFor more information about the
DROP RESOURCE POOLstatement, see DROP RESOURCE POOL.Query the
DBA_OB_RESOURCE_POOLSview to verify whether the resource pool is successfully dropped.obclient [oceanbase]> SELECT * FROM DBA_OB_RESOURCE_POOLS WHERE NAME = 'mq_pool_02'; Empty set