Table Space Management   «Prev  Next»

Use Database Resource Manager in Oracle 26ai - Exercise

Objective: Write a PL/SQL block that creates, validates, and submits a single-level PDB resource plan with consumer groups and shares-based directives.

Background

A pet-supply application has browsing, shopping-cart, and checkout workloads. Design EPETS_PLAN to favor checkout when these workloads compete for CPU. Use the policy below to create the plan definitions.

This is a written exercise. Enter your proposed code and explanation, then compare them with the reference solution. The website does not execute SQL, connect to Oracle, or automatically grade your answer.

Required directives for EPETS_PLAN
Consumer groupWorkloadSHARESDOP limit
BUYERCheckout and purchases51
SHOPPERShopping-cart work31
LOOKERBrowsing and general information14
OTHER_GROUPSFallback coverage11

SHARES are relative weights, not CPU caps or reserved percentages of the physical server. The DOP limit governs parallelism per operation, not the number of connected sessions. These values are teaching choices.

Assumptions

Assume a self-managed Oracle 26ai test PDB, an administrator with ADMINISTER_RESOURCE_MANAGER, unused names for EPETS_PLAN, BUYER, SHOPPER, and LOOKER, and no other pending Resource Manager changes. OTHER_GROUPS is built in. If you later run the example in a lab, first verify the container and inspect existing definitions; do not delete them or clear another administrator's pending work.

Your Tasks

  1. Open a pending area and create EPETS_PLAN with a descriptive comment.
  2. Create BUYER, SHOPPER, and LOOKER. Do not create OTHER_GROUPS.
  3. Create one directive for each of the four groups in the policy table. Use shares and parallel_degree_limit_p1. Do not add CPU levels, utilization ceilings, active-call limits, or subplans.
  4. Validate the pending area and submit it. Put the calls in one anonymous PL/SQL block and include the SQL*Plus execution slash on a separate line.
  5. In two or three sentences, explain why submission alone does not make application sessions run under this new policy, and identify the remaining configuration and verification steps.

For this exercise, write the definition block only. Mapping users, granting group-switch privileges, and activating the plan are follow-up steps to describe, not commands to include.

Hints

Use CREATE_PENDING_AREA, CREATE_PLAN, CREATE_CONSUMER_GROUP, CREATE_PLAN_DIRECTIVE, VALIDATE_PENDING_AREA, and SUBMIT_PENDING_AREA from DBMS_RESOURCE_MANAGER. Review the Resource Manager implementation lesson for the sequence.

Submit Your Answer

Submit plain text. Your answer will be displayed with the reference solution for comparison.