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 remove a resource pool from the tenant by modifying the tenant's resource pool configuration. For more information, see Modify tenant properties.
If a tenant has only one resource pool, you cannot directly remove it.
- Create a new resource pool and allocate it to the tenant, then release the resource pool to be dropped by modifying the resource pool configuration. For instructions on creating a resource pool, see Create a tenant.
- 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 in 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;Confirm the resource pool configuration through the
DBA_OB_RESOURCE_POOLSview. IfTENANT_IDisNULL, the resource pool is not allocated to any tenant and can be dropped.For example, query the configuration information of
mq_pool_02: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.Drop the resource pool using the
DROP RESOURCE POOLstatement.For example, drop the resource pool
mq_pool_02: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 confirm that the resource pool is successfully dropped.obclient [oceanbase]> SELECT * FROM DBA_OB_RESOURCE_POOLS WHERE NAME = 'mq_pool_02'; Empty set