The CREATE_PLAN_DIRECTIVE procedure is used to create a resource plan directive.
Function applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition only provides MySQL-compatible 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 use group or subplan. |
| comment | The comment for a plan instruction. |
| mgmt_p1 | The maximum CPU percentage, relative to available CPU resources, in system full load. |
| utilization_limit | The upper limit of CPU resource utilization. The value of this parameter ranges from [0, 100]. "100" indicates that tenants can fully utilize the CPU resources. If this parameter is set to 20, the maximum tenant CPU resource utilization is 20%. |
| MIN_IOPS | IOPS resources reserved during I/O contention. The sum of the MIN_IOPS values of all resource groups cannot exceed 100, with a default value of 0. |
| MAX_IOPS | IOPS resource limit. The sum of the MAX_IOPS values for all resource groups can exceed 100. The default value is 100. |
| WEIGHT_IOPS | The IOPS resource weight during I/O resource contention, which can be greater than 100 for all resource groups. This weight is normalized. The default value is 0. |
| MAX_NET_BANDWIDTH | Specifies the maximum amount of network bandwidth resources that can be used. The total can exceed 100, and the default value is 100. |
| NET_BANDWIDTH_WEIGHT | Specifies the weight of the network bandwidth. The sum can exceed 100 and is distributed proportionally. The default value is 0. |
Examples
Bind
group1to theDAYresource plan, and specify the resource plan directives 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 ;Bind the resource group
big_groupto the resource planplan_a, and specify the resource plan 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 preferred', 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.