This topic describes how to drop a resource pool.
Prerequisites
Before dropping a resource pool, make sure that the resource pool is not being used by any tenants. If the resource pool is being used by a tenant, you need to release the resource pool before dropping it.
If a tenant has multiple resource pools, you can drop a resource pool from the tenant by modifying the tenant’s resource pool configuration. For detailed instructions, see Modify attributes of a tenant.
If a tenant has only one resource pool, you cannot directly drop it.
- To drop it, first create a new resource pool and allocate it to the tenant, then release the target resource pool by modifying the resource pool configuration. For instructions on creating a resource pool, see the “Create a resource pool” section in the Create a tenant topic.
- If the tenant is no longer in use, you can drop the tenant first, and then drop the resource pool. For instructions on dropping a tenant, see Drop a tenant.
Procedure
Log on to the
systenant of the cluster as therootuser.obclient -h172.30.xx.xx -P2883 -uroot@sys#cluster -p**** -AAccess 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 isNULL, 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 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