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 does not support this feature.
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 | Name of the resource plan. |
| group_or_subplan | The name of the resource usage group or subplan. |
| comment | A comment about the plan directive. |
| mgmt_p1 | Specifies the maximum percentage of CPU resources available in the event that the system reaches full load. |
| utilization_limit | The maximum percentage of CPU resources that can be used. The value of this parameter ranges from [0, 100]. A value of "100" indicates that the tenant can use all CPU resources. A value of 20 indicates that the tenant can use up to 20% of the CPU resources. |
| MIN_IOPS | The percentage of IOPS resources that are reserved for I/O contention. The total percentage of the MIN_IOPS parameter across all resource groups must not exceed 100. The default value is 0. |
| MAX_IOPS | The maximum IOPS for the resource group. The total of all MAX_IOPS values for all resource groups can exceed 100. Default value is 100. |
| WEIGHT_IOPS | IOPS resource weight when I/O resource contention occurs. The WEIGHT_IOPS values of all resource groups can exceed 100 and will be normalized. Default value: 0. |
| MAX_NET_BANDWIDTH | Specifies the maximum percentage of the network bandwidth resource that can be used and can be greater than 100%. The default value is 100. |
| NET_BANDWIDTH_WEIGHT | specifies the network bandwidth weight value. The sum can exceed 100, and the value is proportionally divided. Default value: 0. |
Examples
Assign
group1to theDAYresource plan and specify the resource plan command for 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 ;You can use the
ASSOCIATE_RESOURCE_PLANprocedure to bind theplan_aresource plan to thebig_groupresource group and specify resource plan instructions for CPU, IOPS, and network bandwidth 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 in a tenant.
