OceanBase Database allows you to execute SQL statements to delete resource pools that are no longer required.
Prerequisites
Before you delete a resource pool, make sure that the resource pool is not being used by any tenant. If the resource pool is being used by a tenant, remove it from the tenant before deleting it. For information about how to remove a resource pool from a tenant, see Remove a resource pool from a tenant.
Procedure
Log on to the
systenant of the cluster as therootuser.Execute the following statement to check whether the to-be-deleted resource pool
resource_pool1is being used by a tenant:obclient> SELECT tenant_id,name FROM oceanbase.DBA_OB_RESOURCE_POOLS WHERE name='resource_pool1'; +-----------+----------------+ | tenant_id | name | +-----------+----------------+ | NULL | resource_pool1 | +-----------+----------------+ 1 row in setThe value of
tenant_idisNULL, which indicates that the resource pool is not used by any tenant.Execute the following statement to delete the resource pool:
Sample statement:
DROP RESOURCE POOL pool_name;Example:
obclient> DROP RESOURCE POOL resource_pool1; Query OK, 0 rows affectedExecute the following statement to check whether the resource pool is deleted:
obclient> SELECT * FROM oceanbase.DBA_OB_RESOURCE_POOLS;The query results do not have
resource_pool1in thenamecolumn, which indicates that the resource pool is deleted.