Delete a resource management plan config

2024-04-19 08:42:50  Updated

Deleting a resource management plan config means removing the CPU resource limits for the resource group in the resource management plan. You can use the DELETE_PLAN_DIRECTIVE subprogram in the DBMS_RESOURCE_MANAGER package to accomplish this.

Prerequisites

Before deleting a resource management plan config, make sure that the corresponding resource management plan and resource group exist. Otherwise, the deletion may fail.

Procedure

  1. Log in to a MySQL tenant of the cluster using the administrator.

  2. Call the DELETE_PLAN_DIRECTIVE subprogram in the DBMS_RESOURCE_MANAGER package to delete the resource management plan config.

    obclient [test]> CALL DBMS_RESOURCE_MANAGER.DELETE_PLAN_DIRECTIVE(
    PLAN => 'daytime',
    GROUP_OR_SUBPLAN => 'interactive_group'
    );
    

    Here, PLAN specifies the resource management plan, and GROUP_OR_SUBPLAN specifies the bound resource group.

    In this example, after the CPU resource limits for the interactive_group resource group are removed, SQL statements that were previously using the resources in the interactive_group resource group will now use the resources in the default resource group OTHER_GROUP.

  3. Query the oceanbase.DBA_RSRC_PLAN_DIRECTIVES view to verify whether the resource management plan config has been deleted.

    obclient [test]> SELECT PLAN, GROUP_OR_SUBPLAN FROM oceanbase.DBA_RSRC_PLAN_DIRECTIVES;
    +---------+------------------+
    | PLAN    | GROUP_OR_SUBPLAN |
    +---------+------------------+
    | DAY     | group1           |
    | daytime | batch_group      |
    +---------+------------------+
    2 rows in set
    

    For more information about the oceanbase.DBA_RSRC_PLAN_DIRECTIVES view, see oceanbase.DBA_RSRC_PLAN_DIRECTIVES.

References

DELETE_PLAN_DIRECTIVE

Contact Us