Update a resource management plan config

2025-12-02 02:50:56  Updated

You can use the UPDATE_PLAN_DIRECTIVE subprogram in the DBMS_RESOURCE_MANAGER package to update a resource management plan config. The content that can be updated includes the resource management plan, the bound resource group, the comments on the resource management plan config, and the limit on the CPU resources available for the resource group.

Prerequisites

If you want to change the original resource management plan or resource group, make sure that you have created a new one. For the steps to create a resource management plan or resource group, see Configure user-level resource isolation.

Procedure

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

  2. Call the UPDATE_PLAN_DIRECTIVE subprogram in the DBMS_RESOURCE_MANAGER package to update the resource management plan config.

    obclient [test]> CALL DBMS_RESOURCE_MANAGER.UPDATE_PLAN_DIRECTIVE(
    PLAN => 'daytime',
    GROUP_OR_SUBPLAN => 'interactive_group' ,
    NEW_COMMENT => 'new',
    NEW_MGMT_P1 => 40,
    NEW_UTILIZATION_LIMIT => 60,
    NEW_MIN_IOPS => 40,
    NEW_MAX_IOPS => 80,
    NEW_WEIGHT_IOPS => 70);
    

    where

    • PLAN: Indicates the name of the new resource management plan.

    • GROUP_OR_SUBPLAN: Indicates the name of the new resource group.

    • NEW_COMMENT: Indicates the new comments on the resource management plan config.

    • NEW_MGMT_P1: Indicates the new percentage of CPU resources available for the resource group when the system runs at full load.

    • NEW_UTILIZATION_LIMIT: Indicates the new upper limit on the CPU resources available for the resource group.

    • NEW_MIN_IOPS: Indicates the new IOPS resources reserved for the resource group in the case of I/O resource contention. The sum of NEW_MIN_IOPS values of all resource groups cannot exceed 100.

    • NEW_MAX_IOPS: Indicates the new maximum IOPS resources available for the resource group. The sum of NEW_MAX_IOPS values of all resource groups can exceed 100.

    • NEW_WEIGHT_IOPS: Indicates the new weight for IOPS resources. The sum of NEW_WEIGHT_IOPS values of all resource groups can exceed 100.

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

    obclient [test]> SELECT PLAN, GROUP_OR_SUBPLAN, MGMT_P1, UTILIZATION_LIMIT FROM oceanbase.DBA_RSRC_PLAN_DIRECTIVES;
    +---------+-------------------+---------+-------------------+
    | PLAN    | GROUP_OR_SUBPLAN  | MGMT_P1 | UTILIZATION_LIMIT |
    +---------+-------------------+---------+-------------------+
    | DAY     | group1            |      80 |               100 |
    | daytime | batch_group       |     100 |                40 |
    | daytime | interactive_group |     100 |                60 |
    +---------+-------------------+---------+-------------------+
    3 rows in set
    
    obclient [test]> SELECT * FROM oceanbase.DBA_OB_RSRC_IO_DIRECTIVES;
    

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

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

References

UPDATE_PLAN_DIRECTIVE

Contact Us