Table Space Management   «Prev  Next»

Use Database Resource Manager - Exercise

Create a plan


Objective: Create parts of a plan using DB Resource Manager

Background/overview

You saw how to create a plan, some consumer groups, and some plan directives in the SlideShow in this lesson. Now you can practice writing the code in the simulation found here.

Instructions

Follow the instructions on each screen of the simulation.
Hints: Look at the SlideShow for syntax and examples.

Submitting your exercise

Run the simulation. Instructions only

Simulation name: plan_test


To create the plan directive, you have to create and execute all these PL/SQL commands.
In the simulation you created the first consumer group, the first plan directive, and the validation command.
I have listed all the necessary PL/SQL commands so that you have a complete example for reference later.
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA;
END;
/
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_PLAN (
plan =>'EPETS_PLAN',
comment => 'New plan.');
END;
/
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_CONSUMER_GROUP (
consumer_group => 'LOOKER',
comment => 'View general information');
END;
/
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_CONSUMER_GROUP (
consumer_group => 'SHOPPER',
comment => 'Run shopping cart');
END;
/
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_CONSUMER_GROUP (
consumer_group => 'BUYER',
comment => 'Purchase items.');
END;
/
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE (
plan => 'EPETS_PLAN',
group_or_subplan => 'SHOPPER',
comment => 'Medium priority',
cpu_p1 => 30,
cpu_p2 => 20,
parallel_degree_limit_p1 => NULL);
END;
/
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE (
plan => 'EPETS_PLAN',
group_or_subplan => 'LOOKER',
comment => 'Low priority',
cpu_p1 => 10,
cpu_p2 => 10,
parallel_degree_limit_p1 => 4);
END;
/
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE (
plan => 'EPETS_PLAN',
group_or_subplan => 'OTHER_GROUPS',
comment => 'Low priority',
cpu_p1 => 10,
cpu_p2 => 10,
parallel_degree_limit_p1 => NULL);
END;
/
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE (
plan => 'EPETS_PLAN',
group_or_subplan => 'BUYER',
comment => 'Top priority',
cpu_p1 => 50,
parallel_degree_limit_p1 => NULL);
END;
/
BEGIN
DBMS_RESOURCE_MANAGER.VALIDATE_PENDING_AREA;
END;
/
BEGIN
DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA;
END;
/