The document discusses Oracle Database 12c Resource Manager capabilities for managing resources in Container Databases (CDBs) and Pluggable Databases (PDBs). The key points are:
1. Resource Manager can manage resources at both the CDB level, allocating resources between PDBs, and at the PDB level, allocating resources between sessions within each PDB.
2. At the CDB level, Resource Manager uses shares to define the proportion of CDB resources allocated to each PDB and limits to control each PDB's resource usage.
3. At the PDB level, Resource Manager uses resource plans to allocate resources between consumer groups, similar to how it manages resources within a non-CDB database.
2. Resource Manager with Container Databases (CDB) and
Pluggable Databases (PDB) in Oracle Database 12c Release 1
(12.1)
⢠Regulator for resource contention and cap resource usage using
Resource Manager
⢠Resource Manager supports all types of alliances
⢠âSchema consolidation
⢠âServer consolidation
⢠â IN Pluggable Databases
⢠⢠Resource Manager manages
⢠âCPU
⢠âExadata disk I/O
⢠âParallel execution
⢠âRunaway queries
⢠âAnd moreâŚ
Check detailed contents on
http://dbaboss.com/
2
3. ⢠In a non-CDB, you can use Resource Manager to accomplish
numerous workloads that are
⢠competing for system and database resources. However, in a CDB,
you can have numerous workloads within multiple PDBs contending
for system and CDB resources.
⢠In a CDB, Resource Manager can accomplish resources on two basic
levels:
⢠⢠CDB level: Resource Manager can accomplish the workloads for
multiple PDBs that are competing for system and CDB resources.
You can stipulate how resources are allocated to PDBs, and you can
limit the resource utilization of specific PDBs.
⢠⢠PDB level: Resource Manager can manage the workloads within
each PDB.Resource Manager allocates the resources in two steps:
⢠1. It allocates a slice of the systemâs resources to each PDB.
⢠2. In a specific PDB, it allocates a portion of system resources gained
in Step 1 to each session connected to the PDB.
Check detailed contents on
http://dbaboss.com/
3
4. ⢠In a CDB with numerous PDBs, some PDBs characteristically are
more significant than others.
⢠Resource Manager enables you to rank the resource (CPU and I/O,
as well as distribution of parallel execution slaves in the context of
parallel statement queuing) practice of specific PDBs.
⢠This is done by granting different PDBs different shares of the
system resources so that more resources are allocated to the more
important PDBs.
⢠In addition, limits can be used to confine the system resource usage
of specific PDBs.
⢠When a PDB is plugged in to a CDB and no instruction is defined for
it, the PDB uses the default
⢠instruction for PDBs. As the CDB DBA, you can regulates default and
you can also create specific directive for each new PDB.
⢠Note: No consumer groups nor shares can be defined for the root
container.
Check detailed contents on
http://dbaboss.com/
4
5. ⢠In a multitenant environment Resource Manager performs two separate tasks.
At the CDB level it controls the resources allocated to each PDB, allowing you
to priorities some PDBs over others. At the PDB level it controls the resources
allocated to each session connected to the PDB, allowing you to priorities
some sessions over others, just as it does in pre-12c instances
⢠What Explanations Does Resource Manager Provide for a
CDB?
⢠By default, the whole system may have the following
problems:
⢠- Unfitting distribution of resources among PDBs; All PDBs
have same level of priority.
⢠- Unfitting distribution of resources within a single PDB; All
workloads within a PDB have same level of priority.
⢠- Lack of resource practice data for PDBs.
⢠Oracle Resource Manager helps to overcome these problems.
⢠Oracle Resource Manager manages resources:
⢠- Between PDBs.
⢠- With a single PDBCheck detailed contents on
http://dbaboss.com/
5
6. ⢠Creating a CDB Resource Plan
⢠1. Create a pending area.
⢠2. Create a CDB resource plan.
⢠3. Create directives for the PDBs.
⢠4. (Optional) Update the default PDB directives.
⢠5. (Optional) Update the default autotask
directives.
⢠6. Validate the pending area.
⢠7. Submit the pending area.
⢠DBMS_RESOURCE_MANAGER
Check detailed contents on
http://dbaboss.com/
6
7. ⢠Create CDB Resource Plan
⢠A CDB resource plan is made up of CDB resource plan directives. The plan
directives allocate shares, which define the proportion of the CDB resources
available to the PDB, and specific utilization percentages, that give a finer level of
control. CDB resource plans are managed using the DBMS_RESOURCE_MANAGER
package. Each plan directive is made up of the following elements:
⢠â˘pluggable_database : The PDB the directive relates to.
⢠â˘shares : The proportion of the CDB resources available to the PDB.
⢠â˘utilization_limit : The percentage of the CDBs available CPU that is available to
the PDB.
⢠â˘parallel_server_limit : The percentage of the CDBs available parallel servers
(PARALLEL_SERVERS_TARGET initialization parameter) that are available to the
PDB.
â˘
⢠PDBs without a specific plan directive use the default PDB directive.
⢠The following code creates a new CBD resource plan using the CREATE_CDB_PLAN
procedure, then adds two plan directives using the CREATE_CDB_PLAN_DIRECTIVE
procedure
Check detailed contents on
http://dbaboss.com/
7
8. ⢠The following code creates a new CBD resource plan using the CREATE_CDB_PLAN procedure, then adds two plan
directives using the CREATE_CDB_PLAN_DIRECTIVE procedure.
⢠DECLARE
⢠l_plan VARCHAR2(30) := 'test_cdb_plan';
⢠BEGIN
⢠DBMS_RESOURCE_MANAGER.clear_pending_area;
⢠DBMS_RESOURCE_MANAGER.create_pending_area;
⢠DBMS_RESOURCE_MANAGER.create_cdb_plan(
⢠plan => l_plan,
⢠comment => 'A test CDB resource plan');
⢠DBMS_RESOURCE_MANAGER.create_cdb_plan_directive(
⢠plan => l_plan,
⢠pluggable_database => 'pdb1',
⢠shares => 3,
⢠utilization_limit => 100,
⢠parallel_server_limit => 100);
⢠DBMS_RESOURCE_MANAGER.create_cdb_plan_directive(
⢠plan => l_plan,
⢠pluggable_database => 'pdb2',
⢠shares => 3,
⢠utilization_limit => 100,
⢠parallel_server_limit => 100);
⢠DBMS_RESOURCE_MANAGER.validate_pending_area;
⢠DBMS_RESOURCE_MANAGER.submit_pending_area;
⢠END;
⢠/ Check detailed contents on
http://dbaboss.com/
8
9. ⢠Information about the available CDB resource plans can be queried using the DBA_CDB_
⢠RSRC_PLANS
⢠SELECT plan_id,
⢠plan,
⢠comments,
⢠status,
⢠mandatory
⢠FROM dba_cdb_rsrc_plans
⢠WHERE plan = 'TEST_CDB_PLAN';
⢠PLAN_ID PLAN COMMENTS STATUS MAN
⢠---------- ------------------------------ ------------------------------ ---------- ---
⢠92235 TEST_CDB_PLAN A test CDB resource plan NO
Check detailed contents on
http://dbaboss.com/
9
10. ⢠Information about the CDB resource plan directives can be queried using
the DBA_CDB_RSRC_PLAN_DIRECTIVES view.
⢠SELECT plan,
⢠pluggable_database,
⢠shares,
⢠utilization_limit AS util,
⢠parallel_server_limit AS parallel
⢠FROM dba_cdb_rsrc_plan_directives
⢠WHERE plan = 'TEST_CDB_PLAN'
⢠ORDER BY pluggable_database;
â˘
⢠PLAN PLUGGABLE_DATABASE SHARES UTIL PARALLEL
⢠------------------------------ ------------------------- ---------- ---------- ----------
⢠TEST_CDB_PLAN ORA$AUTOTASK 90 100
⢠TEST_CDB_PLAN ORA$DEFAULT_PDB_DIRECTIVE 1 100 100
⢠TEST_CDB_PLAN PDB1 3 100 100
⢠TEST_CDB_PLAN PDB2 3 100 100
Check detailed contents on
http://dbaboss.com/
10
11. ⢠Modify CDB Resource Plan
⢠An existing resource plan is modified by creating, updating or deleting plan directives. The following
code uses the CREATE_CDB_PLAN_DIRECTIVE procedure to add a new plan directive to the CDB
resource plan we created previously
⢠DECLARE
⢠l_plan VARCHAR2(30) := 'test_cdb_plan';
⢠BEGIN
⢠DBMS_RESOURCE_MANAGER.clear_pending_area;
⢠DBMS_RESOURCE_MANAGER.create_pending_area;
⢠DBMS_RESOURCE_MANAGER.create_cdb_plan_directive(
⢠plan => l_plan,
⢠pluggable_database => 'pdb3',
⢠shares => 1,
⢠utilization_limit => 75,
⢠parallel_server_limit => 75);
⢠DBMS_RESOURCE_MANAGER.validate_pending_area;
⢠DBMS_RESOURCE_MANAGER.submit_pending_area;
⢠END;
⢠/
⢠SQL> @cdb_resource_plan_directives.sql TEST_CDB_PLAN
Check detailed contents on
http://dbaboss.com/
11
12. ⢠Enable/Disable Resource Plan
⢠Enabling and disabling resource plans in a CDB is the same as it was in pre-12c instances. Enable a plan by setting
the RESOURCE_MANAGER_PLAN paramter to the name of the CDB resource plan, while connected to the root
container.
⢠SQL> ALTER SYSTEM SET RESOURCE_MANAGER_PLAN = 'TEST_CDB_PLAN';
⢠System altered.
⢠SQL> SHOW PARAMETER RESOURCE_MANAGER_PLAN
⢠NAME TYPE VALUE
⢠------------------------------------ ----------- ------------------------------
⢠resource_manager_plan string TEST_CDB_PLAN
⢠SQL>
⢠To disable the plan, set the RESOURCE_MANAGER_PLAN parameter to another plan, or blank it.
⢠SQL> ALTER SYSTEM SET RESOURCE_MANAGER_PLAN = '';
⢠System altered.
⢠SQL> SHOW PARAMETER RESOURCE_MANAGER_PLAN
⢠NAME TYPE VALUE
⢠------------------------------------ ----------- ------------------------------
⢠resource_manager_plan string
⢠SQL>
Check detailed contents on
http://dbaboss.com/
12
13. Managing Resources Within a PDB
⢠In a non-CDB database, workloads within a database are
⢠managed with resource plans.
⢠In a PDB, workloads are also managed with resource
⢠plans, also called PDB resource plans.
⢠The functionality is similar except for the following
⢠differences:
⢠Non-CDB Database PDB Database
⢠Multi-level resource plans Single-level resource plans only
⢠Up to 32 consumer groups Up to 8 consumer groups
⢠Subplans No subplans
Check detailed contents on
http://dbaboss.com/
13
14. ⢠A CDB resource plan determines the amount of resources
allocated to each PDB. A PDB resource plan determines
how the resources allocated to a specific PDB are allocated
to consumer groups within that PDB. A PDB resource plan is
similar to a resource plan for a non-CDB. Specifically, a PDB
resource plan allocates resource among the consumer
groups within a PDB.
⢠In a CDB, the following restrictions apply to PDB resource
plans:
⢠⢠PDB resource plan cannot have a multiple-level
scheduling policy.
⢠⢠PDB resource plan can have a maximum of eight
consumer groups.
⢠⢠PDB resource plan cannot have subplans.
⢠Note: If you try to create a PDB plan in the root, you get an
error.
Check detailed contents on
http://dbaboss.com/
14
15. ⢠Managing PDB Resource Plans
⢠Connect to the PDB to manage the PDB plan.
⢠Use exactly the same procedures as for managing a
⢠resource plan in a non-CDB environment.
⢠For CREATE_PLAN_DIRECTIVE procedure:
⢠â New SHARE argument
⢠â Replace MAX_UTILIZATION_LIMIT and
⢠PARALLEL_TARGET_PERCENTAGE arguments with
⢠UTILIZATION_LIMIT and PARALLEL_SERVER_LIMIT
⢠⢠You can view CDB and PDB resource plans using
⢠V$RSRC_PLAN.
Check detailed contents on
http://dbaboss.com/
15
16. ⢠Limits to restrict resource utilization for specific PDB:
⢠A utilization limit restrains the system resource usage of a specific
PDB. You can specify utilization limits for CPU and parallel execution
servers. The limits are default to 100%.
⢠Limits restrict the resource utilization; you can create a Resource
Manager Plan directive using the UTILIZATION_LIMIT parameter to
limit CPU for each PDB. For example, if you create a plan directive
with a UTILIZATION_LIMIT parameter equal to 20% for a specific
PDB, the later will get 20% the maximum of CPU usage at CDB level.
⢠For parallel execution servers, you can override the default defined
by the UTILIZATION_LIMIT by creating a plan directive that uses the
PARALLEL_SERVER_LIMIT parameter. A PDB cannot use more than
the value of the PARALLEL_SERVERS_TARGET initialization
parameter multiplied by the value of the PARALLEL_SERVER_LIMIT
parameter in the CREATE_CDB_PLAN_DIRECTIVE procedure. For
example, if the PARALLEL_SERVERS_TARGET initialization parameter
is set to 100 and the PARALLEL_SERVER_LIMIT parameter for a PDB
is set to 20%, then utilization limit for the PDB is 20 parallel
execution servers (100 X 0.20).
Check detailed contents on
http://dbaboss.com/
16
17. . Creating a PDB resource plan:
⢠CDB resource plan determines the amount of resources allocated to each PDB within the
multitenant environment. A PDB resource plan determines how the resources allocated to a
specific PDB are allocated to consumer groups within that PDB. A PDB resource plan is similar
to a resource plan for a non-CDB, thus similar to previous versions of Oracle database.
⢠The following is a summary of the steps required to create a PDB resource plan:
⢠1. In SQL*Plus, ensure that the current container is a PDB.
⢠2. Create a pending area using the CREATE_PENDING_AREA procedure.
⢠3. Create, modify, or delete consumer groups using the CREATE_CONSUMER_GROUP
procedure.
⢠4. Map sessions to consumer groups using the SET_CONSUMER_GROUP_MAPPING
procedure.
⢠5. Create the PDB resource plan using the CREATE_PLAN procedure.
⢠6. Create PDB resource plan directives using the CREATE_PLAN_DIRECTIVE procedure.
⢠7. Validate the pending area using the VALIDATE_PENDING_AREA procedure.
⢠8. Submit the pending area using the SUBMIT_PENDING_AREA procedure.
Check detailed contents on
http://dbaboss.com/
17
19. Manage Memory
⢠Avoid excessive memory usage
⢠âSwapping
⢠âPoor performance
⢠âInstance eviction
⢠â˘Ensure memory for kernel, stack space, other
applications
⢠â˘Memory controls
⢠âsga_target
⢠âpga_aggregate_target
⢠âpga_aggregate_limit New in 12c
Check detailed contents on
http://dbaboss.com/
19
20. Manage PGA Usage
⢠pga_aggregate_target
⢠âOnly controls âtunableâ memory allocations
⢠ââtunableâ means that the operation can opt to
use PGA or temp space
⢠âE.g. hash joins, sorts, etc.
⢠âActual PGA usage is often much higher (3x)
since operations for âuntunableâ memory do not
heed this parameter
⢠âParticularly problematic with parallel queries
with high DOPs, badly behaved PL/SQL
Check detailed contents on
http://dbaboss.com/
20
21. ⢠pga_aggregate_limit New in 12c
⢠âHard PGA memory limit
⢠When actual PGA usage exceeds
PGA_AGGREGATE_LIMIT
⢠âCalls aborted for sessions using the most
memory
⢠âMemory consumption for parallel operations
tracked as a unit
⢠âSYS and fatal background processes
exempted
Check detailed contents on
http://dbaboss.com/
21