Drop a resource pool

2025-01-26 08:21:59  Updated

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

  1. Log in to the sys tenant of the cluster as the root user.

    obclient -h172.30.xx.xx -P2883 -uroot@sys#cluster -p**** -A
    
  2. Access the database named oceanbase.

    obclient [(none)]> USE oceanbase;
    
  3. Query the DBA_OB_RESOURCE_POOLS view for the configuration information about resource pools. If the value of TENANT_ID of 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 set
    

    For more information about the DBA_OB_RESOURCE_POOLS view, see DBA_OB_RESOURCE_POOLS.

  4. Execute the DROP RESOURCE POOL statement 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 affected
    

    For more information about the DROP RESOURCE POOL statement, see DROP RESOURCE POOL.

  5. Query the DBA_OB_RESOURCE_POOLS view to verify whether the resource pool is successfully dropped.

    obclient [oceanbase]> SELECT * FROM DBA_OB_RESOURCE_POOLS WHERE NAME = 'mq_pool_02';
    Empty set
    

References

Contact Us