Overview
You can create a resouce plan in CDB level or PDB level, or both. This post summarizes how to use resource manager in CDB. The CDB level resource plan controls resouce allocation between individual PDBs, and the PDB level resouce plan controls resouce allocation between consumer groups.
You have two options when creating resouce plan directives, plan directive for individual PDBs or plan directive for performance profiles.
There are three plan directive attributes you can set, shares, utilization_limit, and parallel_server_limit.
When you create resouce plan in PDB level, the following restrictions apply,
A PDB resource plan cannot have subplans. A PDB resource plan can have a maximum of eight consumer groups. A PDB resource plan cannot have a multiple-level scheduling policy.
1. memory limits for PDBs
The following parameters control the memory limits for PDBs,
Prerequistes: NONCDB_COMPATIBLE=false, MEMORY_TARGET=0
DB_CACHE_SIZE SHARED_POOL_SIZE PGA_AGGREGATE_LIMIT PGA_AGGREGATE_TARGET SGA_MIN_SIZE SGA_TARGET
2. I/O limits for PDBs
The following parameters cannot be set in non-CDB. They can be set in PDBs or root. The PDB level setting overrides setting in root.
MAX_IOPS MAX_MBPS
3. the common procedures when create/update/delete a plan or plan directive
exec DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA(); exec DBMS_RESOURCE_MANAGER.VALIDATE_PENDING_AREA(); exec DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA();
4. create/update/delete CDB plan
BEGIN DBMS_RESOURCE_MANAGER.CREATE_CDB_PLAN( plan => 'newcdb_plan', comment => 'CDB resource plan for newcdb'); END; / BEGIN DBMS_RESOURCE_MANAGER.UPDATE_CDB_PLAN( plan => 'newcdb_plan', new_comment => 'CDB plan for PDBs in newcdb'); END; / BEGIN DBMS_RESOURCE_MANAGER.DELETE_CDB_PLAN( plan => 'newcdb_plan'); END; /
5. create/update/delete resource plan directive for individual PDBs
BEGIN DBMS_RESOURCE_MANAGER.CREATE_CDB_PLAN_DIRECTIVE( plan => 'newcdb_plan', pluggable_database => 'salespdb', shares => 3, utilization_limit => 100, parallel_server_limit => 100); END; / BEGIN DBMS_RESOURCE_MANAGER.UPDATE_CDB_PLAN_DIRECTIVE( plan => 'newcdb_plan', pluggable_database => 'operpdb', new_shares => 1, new_utilization_limit => 10, new_parallel_server_limit => 20); END; / BEGIN DBMS_RESOURCE_MANAGER.DELETE_CDB_PLAN_DIRECTIVE( plan => 'newcdb_plan', pluggable_database => 'operpdb'); END; /
6. create/update/delete resource plan directive for performance profiles
BEGIN DBMS_RESOURCE_MANAGER.CREATE_CDB_PROFILE_DIRECTIVE( plan => 'newcdb_plan', profile => 'gold', shares => 3, utilization_limit => 100, parallel_server_limit => 100); END; / BEGIN DBMS_RESOURCE_MANAGER.CREATE_CDB_PROFILE_DIRECTIVE( plan => 'newcdb_plan', profile => 'silver', shares => 2, utilization_limit => 40, parallel_server_limit => 40); END; / BEGIN DBMS_RESOURCE_MANAGER.UPDATE_CDB_PROFILE_DIRECTIVE( plan => 'newcdb_plan', profile => 'copper', new_shares => 1, new_utilization_limit => 10, new_parallel_server_limit => 20); END; / BEGIN DBMS_RESOURCE_MANAGER.DELETE_CDB_PLAN_DIRECTIVE( plan => 'newcdb_plan', profile => 'operpdb'); END; /
7. update the default directive for PDBs
BEGIN DBMS_RESOURCE_MANAGER.UPDATE_CDB_DEFAULT_DIRECTIVE( plan => 'newcdb_plan', new_shares => 1, new_utilization_limit => 50, new_parallel_server_limit => 50); END; /
8. update the autotask directive
BEGIN DBMS_RESOURCE_MANAGER.UPDATE_CDB_AUTOTASK_DIRECTIVE( plan => 'newcdb_plan', new_shares => 1, new_utilization_limit => 75, new_parallel_server_limit => 75); END; /
9. enable/disable resource manager
ALTER SYSTEM SET RESOURCE_MANAGER_PLAN = 'newcdb_plan'; ALTER SYSTEM SET RESOURCE_MANAGER_PLAN = ''; ALTER SYSTEM SET RESOURCE_MANAGER_PLAN = 'salespdb_plan'; ALTER SYSTEM SET RESOURCE_MANAGER_PLAN = '';
10. monitoring resource manager
DBA_CDB_RSRC_PLAN_DIRECTIVES V$RSRCPDBMETRIC V$RSRCPDBMETRIC_HISTORY DBA_HIST_RSRC_PDB_METRIC