The CREATE_PLAN_DIRECTIVE procedure is used to create a resource plan directive.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL mode.
Syntax
DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE (
PLAN IN VARCHAR2,
GROUP_OR_SUBPLAN IN VARCHAR2,
COMMENT IN VARCHAR2 DEFAULT'',
MGMT_P1 IN NUMBER DEFAULT 100,
UTILIZATION_LIMIT IN NUMBER DEFAULT 100,
MIN_IOPS IN NUMBER DEFAULT 0,
MAX_IOPS IN NUMBER DEFAULT 100,
WEIGHT_IOPS IN NUMBER DEFAULT 0,
MAX_NET_BANDWIDTH IN INT DEFAULT 100,
NET_BANDWIDTH_WEIGHT IN INT DEFAULT 0);
Parameters
| Parameter | Description |
|---|---|
| plan | The name of the resource plan. |
| group_or_subplan | The name of the resource group or subplan. |
| comment | The comment for the plan directive. |
| mgmt_p1 | The maximum CPU utilization ratio when the system is at full load. |
| utilization_limit | The upper limit of CPU resource utilization. The value of this parameter ranges from [0, 100]. "100" indicates that the tenant can use all CPU resources. If the value is 20, the tenant can use up to 20% of the CPU resources. |
| MIN_IOPS | The IOPS resources reserved for I/O contention. The sum of MIN_IOPS across all resource groups cannot exceed 100. The default value is 0. |
| MAX_IOPS | The upper limit of IOPS resources. The sum of MAX_IOPS across all resource groups can exceed 100. The default value is 100. |
| WEIGHT_IOPS | The IOPS resource weight when I/O resources are in contention. The sum of WEIGHT_IOPS across all resource groups can exceed 100 and will be normalized. The default value is 0. |
| MAX_NET_BANDWIDTH | The maximum network bandwidth resources that can be used. The total can exceed 100. The default value is 100. |
| NET_BANDWIDTH_WEIGHT | The weight of the network bandwidth. The total can exceed 100, and it will be proportionally divided. The default value is 0. |
Examples
Bind the resource group
group1to the resource planDAYand specify the resource plan directive for the CPU resources in the resource group.obclient [SYS]> delimiter //obclient> BEGIN DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE( PLAN=>'DAY', GROUP_OR_SUBPLAN=>'group1', mgmt_p1=>80, utilization_limit=>100); END; //obclient [SYS]> delimiter ;Bind the resource group
big_groupto the resource planplan_aand specify the resource plan directive for the CPU, IOPS, and network bandwidth resources in the resource group.obclient [SYS]> delimiter //obclient [SYS]> BEGIN DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE( PLAN => 'plan_a', GROUP_OR_SUBPLAN => 'big_group', COMMENT => 'TP priority', UTILIZATION_LIMIT =>60, MIN_IOPS => 20, MAX_IOPS => 100, WEIGHT_IOPS => 20, MAX_NET_BANDWIDTH => 50, NET_BANDWIDTH_WEIGHT =>50); END; //obclient [SYS]> delimiter ;
References
For more information about how to configure resource isolation, see Configure resource isolation within a tenant.