-- -----------------------------------------------------------------------------------
-- File Name    : cdb_resource_plan_directives.sql
-- Author       : DBA Learning Hub
-- Description  : Displays CDB resource plan directives.
-- Requirements : Access to the DBA views.
-- Call Syntax  : @cdb_resource_plan_directives.sql (plan-name or all)
-- Last Modified: 15/07/2025
-- -----------------------------------------------------------------------------------

COLUMN plan FORMAT A30
COLUMN pluggable_database FORMAT A25
SET LINESIZE 100 VERIFY OFF

SELECT plan, 
       pluggable_database, 
       shares, 
       utilization_limit AS util,
       parallel_server_limit AS parallel
FROM   dba_cdb_rsrc_plan_directives
WHERE  plan = DECODE(UPPER('&1'), 'ALL', plan, UPPER('&1'))
ORDER BY plan, pluggable_database;

SET VERIFY ON