Database Reference
In-Depth Information
Creating resource plans for the PDB
Resource plans for PDBs are created while connected to the PDB with an administrative user. Depending on how you
created your user-PDB, you might have granted the admin user the necessary privileges already. Alternatively connect
as a common user to the PDB directly. The following example makes use of the SYSTEM account to create a simple
resource plan.
The Database Resource Manager is a lot more powerful and offers a lot more options than I can reasonably
present in this chapter. If you want to learn more about it I recommend you read the relevant sections in the
Administrator's Guide. This example focuses on running swingbench in the three PDBs created. The focus for this
benchmark is to allow the SOE account, who by default owns the order entry schema, to execute his tasks without
being preempted. To that effect, a new resource consumer group “swingbench” is created (note the connection to
the PDB!)
SYSTEM@SWINGBENCH1> begin
2 dbms_resource_manager.clear_pending_area;
3 dbms_resource_manager.create_pending_area;
4 dbms_resource_manager.create_consumer_group(
5 consumer_group => 'SWINGBENCH_GROUP',
6 comment => 'used for the execution of order entry benchmark');
7 dbms_resource_manager.validate_pending_area;
8 dbms_resource_manager.submit_pending_area;
9 end;
10 /
PL/SQL procedure successfully completed.
The mandatory SYS_GROUP and OTHER will be part of the resource plan too. Let's create the plan, using the
CPU method of ratio for a simple enough plan:
SYSTEM@SWINGBENCH1> begin
2 -- clear the pending area and create a new one
3 DBMS_RESOURCE_MANAGER.CLEAR_PENDING_AREA;
4 DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA;
5
6 -- create the plan-specific to PDB swingbench1. This
7 -- is a simple example, using RATIOs internally.
8 -- The goal is to have the following ratios:
9 -- 1:2:3:5 for low group, other groups, swingbench group
10 -- and sys group.
11 DBMS_RESOURCE_MANAGER.CREATE_PLAN(
12 plan => 'SWINGBENCH_PLAN_SWINGBENCH1',
13 MGMT_MTH => 'RATIO',
14 comment => 'running swingbench on first PDB');
15
16 -- create a plan directive
17 DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE(
18 plan=>'SWINGBENCH_PLAN_SWINGBENCH1',
19 mgmt_p1 => 1,
20 GROUP_OR_SUBPLAN => 'LOW_GROUP',
21 comment => 'low group');
22
 
Search WWH ::




Custom Search