HOWTO: Resource Manager and IORM by Cluster Service
http://goo.gl/I1mjd• This HOWTO shows the following
o how to make use of Cluster Services to map users on resource manager
o limit the PX slaves per user
o cancel
SQLs running longer than 15secs (just for testing purposes)
o limit the backup operations
o activate the IORM intradatabase plan
Also, at the end of this guide is an INTERDATABASE IORM PLAN
The
FYIs section at the bottom are some of my observations during the test cases
INTRADATABASE IORM PLAN
-- Create the cluster service
#############################################
--Create a service for Reporting sessions
srvctl add service -d dbm -s DBM_REPORTING -r dbm1,dbm2
-- srvctl add service -d dbm -s DBM_REPORTING -r dbm1
srvctl start service -d dbm -s DBM_REPORTING
srvctl stop service -d dbm -s DBM_REPORTING
srvctl remove service -d dbm -s DBM_REPORTING
--Create a service for ETL sessions
srvctl add service -d dbm -s DBM_ETL -r dbm1,dbm2
-- srvctl add service -d dbm -s DBM_ETL -r dbm1
srvctl start service -d dbm -s DBM_ETL
srvctl stop service -d dbm -s DBM_ETL
srvctl remove service -d dbm -s DBM_ETL
-- check service status
srvctl status service -d dbm
-- Create Resource Groups
#############################################
BEGIN
dbms_resource_manager.clear_pending_area();
dbms_resource_manager.create_pending_area();
dbms_resource_manager.create_consumer_group(
consumer_group => 'REPORTING',
comment => 'Consumer group for REPORTS');
dbms_resource_manager.create_consumer_group(
consumer_group => 'ETL',
comment => 'Consumer group for ETL');
dbms_resource_manager.create_consumer_group(
consumer_group => 'MAINT',
comment => 'Consumer group for maintenance jobs');
dbms_resource_manager.validate_pending_area();
dbms_resource_manager.submit_pending_area();
END;
-- Create Consumer Group Mapping Rules
#############################################
BEGIN
dbms_resource_manager.clear_pending_area();
dbms_resource_manager.create_pending_area();
dbms_resource_manager.set_consumer_group_mapping(
attribute => dbms_resource_manager.service_name,
value => 'DBM_REPORTING',
consumer_group => 'REPORTING');
dbms_resource_manager.set_consumer_group_mapping(
attribute => dbms_resource_manager.service_name,
value => 'DBM_ETL',
consumer_group => 'ETL');
dbms_resource_manager.set_consumer_group_mapping(
attribute => dbms_resource_manager.oracle_function,
value => 'BACKUP',
consumer_group => 'MAINT');
dbms_resource_manager.set_consumer_group_mapping(
attribute => dbms_resource_manager.oracle_function,
value => 'COPY',
consumer_group => 'MAINT');
dbms_resource_manager.validate_pending_area();
dbms_resource_manager.submit_pending_area();
END;
-- Resource Group Mapping Priorities
#############################################
BEGIN
dbms_resource_manager.clear_pending_area();
dbms_resource_manager.create_pending_area();
dbms_resource_manager.set_consumer_group_mapping_pri(
explicit => 1,
service_name => 2,
oracle_user => 3,
client_program => 4,
service_module_action => 5,
service_module => 6,
module_name_action => 7,
module_name => 8,
client_os_user => 9,
client_machine => 10 );
dbms_resource_manager.validate_pending_area();
dbms_resource_manager.submit_pending_area();
END;
-- Create the Resource Plan and Plan Directives
-- * DAYTIME for reports
-- * NIGHTTIME for ETL jobs
#############################################
-- create DAYTIME plan
BEGIN
dbms_resource_manager.clear_pending_area();
dbms_resource_manager.create_pending_area();
dbms_resource_manager.create_plan(
plan => 'DAYTIME',
comment => 'Resource plan for normal business hours');
dbms_resource_manager.create_plan_directive(
plan => 'DAYTIME',
group_or_subplan => 'REPORTING',
comment => 'High priority for users/applications',
mgmt_p1 => 70,
PARALLEL_DEGREE_LIMIT_P1 => 4);
dbms_resource_manager.create_plan_directive(
plan => 'DAYTIME',
group_or_subplan => 'ETL',
comment => 'Medium priority for ETL processing',
mgmt_p2 => 50);
dbms_resource_manager.create_plan_directive(
plan => 'DAYTIME',
group_or_subplan => 'MAINT',
comment => 'Low priority for daytime maintenance',
mgmt_p3 => 50);
dbms_resource_manager.create_plan_directive(
plan => 'DAYTIME',
group_or_subplan => 'OTHER_GROUPS',
comment => 'All other groups not explicitely named in this plan',
mgmt_p3 => 50);
dbms_resource_manager.validate_pending_area();
dbms_resource_manager.submit_pending_area();
END;
-- create NIGHTTIME plan
BEGIN
dbms_resource_manager.clear_pending_area();
dbms_resource_manager.create_pending_area();
dbms_resource_manager.create_plan(
plan => 'NIGHTTIME',
comment => 'Resource plan for ETL hours');
dbms_resource_manager.create_plan_directive(
plan => 'NIGHTTIME',
group_or_subplan => 'ETL',
comment => 'High priority for ETL processing',
mgmt_p1 => 70);
dbms_resource_manager.create_plan_directive(
plan => 'NIGHTTIME',
group_or_subplan => 'REPORTING',
comment => 'Medium priority for users/applications',
mgmt_p2 => 50,
PARALLEL_DEGREE_LIMIT_P1 => 4,
SWITCH_GROUP=>'CANCEL_SQL',
SWITCH_TIME=>15,
SWITCH_ESTIMATE=>false
);
dbms_resource_manager.create_plan_directive(
plan => 'NIGHTTIME',
group_or_subplan => 'MAINT',
comment => 'Low priority for daytime maintenance',
mgmt_p3 => 50);
dbms_resource_manager.create_plan_directive(
plan => 'NIGHTTIME',
group_or_subplan => 'OTHER_GROUPS',
comment => 'All other groups not explicitely named in this plan',
mgmt_p3 => 50);
dbms_resource_manager.validate_pending_area();
dbms_resource_manager.submit_pending_area();
END;
-- Grant the consumer group to the users
-- if you do not do this, the user's RESOURCE_CONSUMER_GROUP will show as OTHER_GROUPS
#############################################
BEGIN
DBMS_RESOURCE_MANAGER.CLEAR_PENDING_AREA();
DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA();
dbms_resource_manager_privs.grant_switch_consumer_group ('oracle','REPORTING',FALSE);
dbms_resource_manager_privs.grant_switch_consumer_group ('oracle','ETL',FALSE);
dbms_resource_manager_privs.grant_switch_consumer_group ('oracle','MAINT',FALSE);
DBMS_RESOURCE_MANAGER.VALIDATE_PENDING_AREA();
DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA();
END;
/
-- Activate the Resource Plan
#############################################
ALTER SYSTEM SET resource_manager_plan='NIGHTTIME' SCOPE=BOTH SID='*';
ALTER SYSTEM SET resource_manager_plan='DAYTIME' SCOPE=BOTH SID='*';
-- to deactivate
ALTER SYSTEM SET resource_manager_plan='' SCOPE=BOTH SID='*';
-- You can also enable the resource plan with the FORCE Option to avoid the Scheduler window to activate a different plan during the job execution.
ALTER SYSTEM SET RESOURCE_MANAGER_PLAN = 'FORCE:DAYTIME';
or
-- The window starts at 11:00 PM (hour 23) and runs through 7:00 AM (480 minutes).
BEGIN
DBMS_SCHEDULER.SET_ATTRIBUTE(
Name => '"SYS"."WEEKNIGHT_WINDOW"',
Attribute => 'RESOURCE_PLAN',
Value => 'NIGHTTIME');
DBMS_SCHEDULER.SET_ATTRIBUTE(
name => '"SYS"."WEEKNIGHT_WINDOW"',
attribute => 'REPEAT_INTERVAL',
value => 'FREQ=WEEKLY;BYDAY=MON,TUE,WED,THU,FRI,SAT,SUN;BYHOUR=23;BYMINUTE=00;BYSECOND=0');
DBMS_SCHEDULER.SET_ATTRIBUTE(
name=>'"SYS"."WEEKNIGHT_WINDOW"',
attribute=>'DURATION',
value=>numtodsinterval(480, 'minute'));
DBMS_SCHEDULER.ENABLE(name=>'"SYS"."WEEKNIGHT_WINDOW"');
END;
-- The window starts at 7:00 AM (hour 7) and runs until 11:00 PM (960 minutes)
BEGIN
DBMS_SCHEDULER.CREATE_WINDOW(
window_name => '"WEEKDAY_WINDOW"',
resource_plan => 'DAYTIME',
start_date => systimestamp at time zone '-6:00',
duration => numtodsinterval(960, 'minute'),
repeat_interval => 'FREQ=WEEKLY;BYDAY=MON,TUE,WED,THU,FRI,SAT,SUN;BYHOUR=7;BYMINUTE=0;BYSECOND=0',
end_date => null,
window_priority => 'HIGH',
comments => 'Weekday window. Sets the active resource plan to DAYTIME');
DBMS_SCHEDULER.ENABLE(name=>'"SYS"."WEEKDAY_WINDOW"');
END;
-- Activate IORM on Exadata
#############################################
-- In each storage cell...
dcli -g ~/cell_group -l root 'cellcli -e list iormplan detail'
dcli -g ~/cell_group -l root 'cellcli -e list iormplan attributes objective'
dcli -g ~/cell_group -l root 'cellcli -e alter iormplan objective = auto'
dcli -g ~/cell_group -l root 'cellcli -e alter iormplan dbPlan=\"\"'
dcli -g ~/cell_group -l root 'cellcli -e alter iormplan catPlan=\"\"'
dcli -g ~/cell_group -l root cellcli -e alter iormplan active
dcli -g ~/cell_group -l root 'cellcli -e list iormplan detail'
dcli -g ~/cell_group -l root 'cellcli -e list iormplan attributes objective'
-- Revert/Delete
#############################################
BEGIN
DBMS_RESOURCE_MANAGER.CLEAR_PENDING_AREA();
DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA();
DBMS_RESOURCE_MANAGER.DELETE_PLAN (PLAN => 'NIGHTTIME');
DBMS_RESOURCE_MANAGER.VALIDATE_PENDING_AREA();
DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA();
END;
/
BEGIN
DBMS_RESOURCE_MANAGER.CLEAR_PENDING_AREA();
DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA();
DBMS_RESOURCE_MANAGER.DELETE_CONSUMER_GROUP(CONSUMER_GROUP => 'REPORTS');
DBMS_RESOURCE_MANAGER.VALIDATE_PENDING_AREA();
DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA();
END;
/
BEGIN
DBMS_RESOURCE_MANAGER.CLEAR_PENDING_AREA();
DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA();
DBMS_RESOURCE_MANAGER.DELETE_CONSUMER_GROUP(CONSUMER_GROUP => 'ETL');
DBMS_RESOURCE_MANAGER.VALIDATE_PENDING_AREA();
DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA();
END;
/
-- Check Resource Manager configuration
#############################################
set wrap off
set head on
set linesize 300
set pagesize 132
col comments format a64
-- show current resource plan
select * from V$RSRC_PLAN;
-- show all resource plans
select PLAN,NUM_PLAN_DIRECTIVES,CPU_METHOD,substr(COMMENTS,1,64) "COMMENTS",STATUS,MANDATORY
from dba_rsrc_plans
order by plan;
-- show consumer groups
select CONSUMER_GROUP,CPU_METHOD,STATUS,MANDATORY,substr(COMMENTS,1,64) "COMMENTS"
from DBA_RSRC_CONSUMER_GROUPS
where CONSUMER_GROUP in ('REPORTING','ETL','MAINT')
order by consumer_group;
-- show category
SELECT consumer_group, category
FROM DBA_RSRC_CONSUMER_GROUPS
ORDER BY category;
-- show mappings
col value format a30
select ATTRIBUTE, VALUE, CONSUMER_GROUP, STATUS
from DBA_RSRC_GROUP_MAPPINGS
where CONSUMER_GROUP in ('REPORTING','ETL','MAINT')
order by 3;
-- show mapping priority
select * from DBA_RSRC_MAPPING_PRIORITY;
-- show directives
SELECT plan,group_or_subplan,cpu_p1,cpu_p2,cpu_p3, PARALLEL_DEGREE_LIMIT_P1, status
FROM dba_rsrc_plan_directives
where plan in ('DAYTIME','NIGHTTIME')
order by 1,3 desc,4 desc,5 desc;
-- show grants
select * from DBA_RSRC_CONSUMER_GROUP_PRIVS order by grantee;
select * from DBA_RSRC_MANAGER_SYSTEM_PRIVS order by grantee;
-- show scheduler windows
select window_name, resource_plan, START_DATE, DURATION, WINDOW_PRIORITY, enabled, active from dba_scheduler_windows;
-- Useful monitoring SQLs
#############################################
## Check the service name used by each session
select inst_id, username, SERVICE_NAME, RESOURCE_CONSUMER_GROUP, count(*)
from gv$session
where SERVICE_NAME <> 'SYS$BACKGROUND'
group by inst_id, username, SERVICE_NAME, RESOURCE_CONSUMER_GROUP order by 2,3,1;
## List the Active Resource Consumer Groups since instance startup
select INST_ID, NAME, ACTIVE_SESSIONS, EXECUTION_WAITERS, REQUESTS, CPU_WAIT_TIME, CPU_WAITS, CONSUMED_CPU_TIME, YIELDS, QUEUE_LENGTH, ACTIVE_SESSION_LIMIT_HIT
from gV$RSRC_CONSUMER_GROUP
-- where name in ('SYS_GROUP','BATCH','OLTP','OTHER_GROUPS')
order by 2,1;
## Session level details
SET pagesize 50
SET linesize 155
SET wrap off
COLUMN name format a11 head "Consumer|Group"
COLUMN sid format 9999
COLUMN username format a16
COLUMN CONSUMED_CPU_TIME head "Consumed|CPU time|(s)" format 999999.9
COLUMN IO_SERVICE_TIME head "I/O time|(s)" format 999999.9
COLUMN CPU_WAIT_TIME head "CPU Wait|Time (s)" FOR 99999
COLUMN CPU_WAITS head "CPU|Waits" format 99999
COLUMN YIELDS head "Yields" format 99999
COLUMN state format a10
COLUMN osuser format a8
COLUMN machine format a16
COLUMN PROGRAM format a12
SELECT
rcg.name
, rsi.sid
, s.username
, rsi.state
, rsi.YIELDS
, rsi.CPU_WAIT_TIME / 1000 AS CPU_WAIT_TIME
, rsi.CPU_WAITS
, rsi.CONSUMED_CPU_TIME / 1000 AS CONSUMED_CPU_TIME
, rsi.IO_SERVICE_TIME /1000 AS IO_SERVICE_TIME
, s.osuser
, s.program
, s.machine
, sw.event
FROM V$RSRC_SESSION_INFO rsi INNER JOIN v$rsrc_consumer_group rcg
ON rsi.CURRENT_CONSUMER_GROUP_ID = rcg.id
INNER JOIN v$session s ON rsi.sid=s.sid
INNER JOIN v$session_wait sw ON s.sid = sw.sid
WHERE rcg.id !=0 -- _ORACLE_BACKGROUND_GROUP_
and (sw.event != 'SQL*Net message from client' or rsi.state='RUNNING')
ORDER BY rcg.name, s.username,rsi.cpu_wait_time + rsi.IO_SERVICE_TIME + rsi.CONSUMED_CPU_TIME ASC, rsi.state, sw.event, s.username, rcg.name,s.machine,s.osuser
/
## By consumer group - time series
set linesize 160
set pagesize 60
set colsep ' '
column total head "Total Available|CPU Seconds" format 99990
column consumed head "Used|Oracle Seconds" format 99990.9
column consumer_group_name head "Consumer|Group Name" format a25 wrap off
column "throttled" head "Oracle Throttled|Time (s)" format 99990.9
column cpu_utilization head "% of Host CPU" format 99990.9
break on time skip 2 page
select to_char(begin_time, 'YYYY-DD-MM HH24:MI:SS') time,
consumer_group_name,
60 * (select value from v$osstat where stat_name = 'NUM_CPUS') as total,
cpu_consumed_time / 1000 as consumed,
cpu_consumed_time / (select value from v$parameter where name = 'cpu_count') / 600 as cpu_utilization,
cpu_wait_time / 1000 as throttled,
IO_MEGABYTES
from v$rsrcmgrmetric_history
order by begin_time,consumer_group_name
/
## High level
set linesize 160
set pagesize 50
set colsep ' '
column "Total Available CPU Seconds" head "Total Available|CPU Seconds" format 99990
column "Used Oracle Seconds" head "Used Oracle|Seconds" format 99990.9
column "Used Host CPU %" head "Used Host|CPU %" format 99990.9
column "Idle Host CPU %" head "Idle Host|CPU %" format 99990.9
column "Total Used Seconds" head "Total Used|Seconds" format 99990.9
column "Idle Seconds" head "Idle|Seconds" format 99990.9
column "Non-Oracle Seconds Used" head "Non-Oracle|Seconds Used" format 99990.9
column "Oracle CPU %" head "Oracle|CPU %" format 99990.9
column "Non-Oracle CPU %" head "Non-Oracle|CPU %" format 99990.9
column "throttled" head "Oracle Throttled|Time (s)" format 99990.9
select to_char(rm.BEGIN_TIME,'YYYY-MM-DD HH24:MI:SS') as BEGIN_TIME
,60 * (select value from v$osstat where stat_name = 'NUM_CPUS') as "Total Available CPU Seconds"
,sum(rm.cpu_consumed_time) / 1000 as "Used Oracle Seconds"
,min(s.value) as "Used Host CPU %"
,(60 * (select value from v$osstat where stat_name = 'NUM_CPUS')) * (min(s.value) / 100) as "Total Used Seconds"
,((100 - min(s.value)) / 100) * (60 * (select value from v$osstat where stat_name = 'NUM_CPUS')) as "Idle Seconds"
,((60 * (select value from v$osstat where stat_name = 'NUM_CPUS')) * (min(s.value) / 100)) - sum(rm.cpu_consumed_time) / 1000 as "Non-Oracle Seconds Used"
,100 - min(s.value) as "Idle Host CPU %"
,((((60 * (select value from v$osstat where stat_name = 'NUM_CPUS')) * (min(s.value) / 100)) - sum(rm.cpu_consumed_time) / 1000) / (60 * (select value from v$osstat where stat_name = 'NUM_CPUS')))*100 as "Non-Oracle CPU %"
,(((sum(rm.cpu_consumed_time) / 1000) / (60 * (select value from v$osstat where stat_name = 'NUM_CPUS'))) * 100) as "Oracle CPU %"
, sum(rm.cpu_wait_time) / 1000 as throttled
from gv$rsrcmgrmetric_history rm
inner join
gV$SYSMETRIC_HISTORY s
on rm.begin_time = s.begin_time
where s.metric_id = 2057
and s.group_id = 2
group by rm.begin_time,s.begin_time
order by rm.begin_time
/
-- PROS/CONS
#############################################
* When you implement a category plan you specify percentage settings a higher level than the database resource manager and this percentage allocation
is generic across the databases. Now, if you want to dynamically alter things you have to do it on both DBRM and on the IORM plans
* If you want it to dynamically change the allocation then just go with the intradatabase plan so you can easily alter the "resource_manager_plan" according to
a scheduler window or just by altering the resource plan
-- FYIs
#############################################
* on resource_manager_cpu_allocation parameter
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cpu_count integer 16 <-- set to do instance caging
parallel_threads_per_cpu integer 1
resource_manager_cpu_allocation integer 32 <-- this parameter is deprecated DON'T ALTER THIS, and if this is set with cpu_count this will take precedence, see warning below
alter system set cpu_count=32 scope=both sid='dbm1';
WARNING: the resource_manager_cpu_allocation was introduced in 11106 and deprecated right away on 11107,
...BUT... if you have this set together with the cpu_count parameter then this will take precedence.
let's say you set both cpu_count to 3 and resource_manager_cpu_allocation to 16 and you have 32 CPUs on the system
and a workload burning all of the 32 CPUs... what will happen is the server will show as 50% utilized (16 CPUs burned) because
the resource_manager_cpu_allocation is set to 16!
* one more reason of deprecating the resource_manager_cpu_allocation parameter is the cpu_count has dependencies on other stuff like the parallel settings, doing so is one less parameter to worry
* for IORM, on a 70/30 percentage plan directive scheme on DAYTIME & NIGHTTIME plans.. the percentage allocation will only take effect at saturation point.. but if only
one consumer group is active then that group should be able to get the 100% of the IO
-- 70/30 NIGHTTIME taking effect on idle CPU, with only 1 session
BENCHMARK ,INSTNAME ,START ,END , ELAPSED, MBs
----------,---------------,-----------------,-----------------,----------,-------
benchmark ,dbm1 ,05/02/13 05:57:46,05/02/13 05:57:58, 12, 2877
BENCHMARK ,INSTNAME ,START ,END , ELAPSED, MBs
----------,---------------,-----------------,-----------------,----------,-------
benchmark ,dbm1 ,05/02/13 05:57:48,05/02/13 05:58:07, 19, 1817
-- 70/30 NIGHTTIME taking effect on idle CPU, but with more sessions doing IOs
-- etl
BENCHMARK ,INSTNAME ,START ,END , ELAPSED, MBs
----------,---------------,-----------------,-----------------,----------,-------
benchmark ,dbm1 ,05/02/13 06:02:58,05/02/13 06:03:17, 18, 1918
BENCHMARK ,INSTNAME ,START ,END , ELAPSED, MBs
----------,---------------,-----------------,-----------------,----------,-------
benchmark ,dbm1 ,05/02/13 06:02:58,05/02/13 06:03:17, 19, 1817
-- reporting
BENCHMARK ,INSTNAME ,START ,END , ELAPSED, MBs
----------,---------------,-----------------,-----------------,----------,-------
benchmark ,dbm1 ,05/02/13 06:03:00,05/02/13 06:03:30, 30, 1151
BENCHMARK ,INSTNAME ,START ,END , ELAPSED, MBs
----------,---------------,-----------------,-----------------,----------,-------
benchmark ,dbm1 ,05/02/13 06:03:00,05/02/13 06:03:30, 30, 1151
-- 70/30 NIGHTTIME taking effect on 100% CPU utilization and 32 AAS "resmgr:cpu quantum"
BENCHMARK ,INSTNAME ,START ,END , ELAPSED, MBs
----------,---------------,-----------------,-----------------,----------,-------
benchmark ,dbm1 ,05/02/13 05:52:07,05/02/13 05:52:22, 14, 2466
BENCHMARK ,INSTNAME ,START ,END , ELAPSED, MBs
----------,---------------,-----------------,-----------------,----------,-------
benchmark ,dbm1 ,05/02/13 05:52:16,05/02/13 05:55:05, 167, 207
* for PX, if you set the PARALLEL_DEGREE_LIMIT_P1=4 then a session will be flagged with a "Req. DOP" of 32 but it will really have an "Actual DOP" of 4
TIME CONSUMER_GROUP_NAME CPU Seconds Oracle Seconds % of Host CPU Time (s) IO_MEGABYTES
------------------- ------------------------------ --------------- -------------- ------------- ---------------- ------------
2013-02-05 05:45:36 ETL 1920 1521.4 79.2 1319.5 68511
MAINT 1920 0.0 0.0 0.0 0
OTHER_GROUPS 1920 10.9 0.6 156.6 0
REPORTING 1920 389.3 20.3 1630.1 1952
_ORACLE_BACKGROUND_GROUP_ 1920 0.0 0.0 0.0 20
TIME CONSUMER_GROUP_NAME CPU Seconds Oracle Seconds % of Host CPU Time (s) IO_MEGABYTES
------------------- ------------------------------ --------------- -------------- ------------- ---------------- ------------
2013-02-05 05:46:37 ETL 1920 1589.9 82.8 343.5 0
MAINT 1920 0.0 0.0 0.0 0
OTHER_GROUPS 1920 10.8 0.6 149.0 0
REPORTING 1920 322.3 16.8 2074.0 15016
_ORACLE_BACKGROUND_GROUP_ 1920 0.0 0.0 0.0 20
* for PX, if you set the PARALLEL_DEGREE_LIMIT_P1=4 and if you have a GROUP BY on the SQL then that part of the operation will be another 4 PX slaves
Username QC/Slave Group SlaveSet SID Slave INS STATE WAIT_EVENT QC SID QC INS Req. DOP Actual DOP SQL_ID
------------ -------- ------ -------- ------ --------- -------- ------------------------------ ------ ------ -------- ---------- -------------
ORACLE QC 684 1 WAIT PX Deq: Execute Reply 684 7bb5hpfv8jd4a
- p028 (Slave) 1 1 3010 1 WAIT PX Deq: Execution Msg 684 1 16 4 7bb5hpfv8jd4a
- p004 (Slave) 1 1 2721 1 WAIT PX Deq: Execution Msg 684 1 16 4 7bb5hpfv8jd4a
- p012 (Slave) 1 1 391 1 WAIT PX Deq: Execution Msg 684 1 16 4 7bb5hpfv8jd4a
- p020 (Slave) 1 1 1559 1 WAIT PX Deq: Execution Msg 684 1 16 4 7bb5hpfv8jd4a
- p060 (Slave) 1 2 3013 1 WAIT cell smart table scan 684 1 16 4 7bb5hpfv8jd4a
- p036 (Slave) 1 2 685 1 WAIT cell smart table scan 684 1 16 4 7bb5hpfv8jd4a
- p044 (Slave) 1 2 1459 1 WAIT cell smart table scan 684 1 16 4 7bb5hpfv8jd4a
- p052 (Slave) 1 2 2237 1 WAIT cell smart table scan 684 1 16 4 7bb5hpfv8jd4a
* for CANCEL_SQL, if you are currently on DAYTIME plan.. and if there's already a long running SQL, if you switch it to NIGHTTIME which has the CANCEL_SQL directive
the SWITCH_TIME of 15secs will take effect upon activation. So a SQL that's already running for 1000secs will be canceled after 1015secs if you switch to the NIGHTTIME
plan at 1000secs
* for MAINT consumer group where we have percentage allocation for RMAN backups, it will only kick in once you execute the backup command "backup incremental level 0 database;"
and if you run reports and ETL while the backup is running.. the percentage allocation for the rest of the consumer groups will take effect.. below the ETL still got the
IO priority than the reporting and backups on NIGHTTIME resource plan
INST_ID USERNAME SERVICE_NAME RESOURCE_CONSUMER_GROUP COUNT(*)
---------- ------------------------------ ---------------------------------------------------------------- -------------------------------- ----------
1 SYS SYS$USERS MAINT 1 <-- the RMAN session
1 SYS SYS$USERS OTHER_GROUPS 8
2 SYS SYS$USERS OTHER_GROUPS 3
TIME CONSUMER_GROUP_NAME CPU Seconds Oracle Seconds % of Host CPU Time (s) IO_MEGABYTES
------------------- ------------------------------ --------------- -------------- ------------- ---------------- ------------
2013-02-05 07:01:37 ETL 1920 0.0 0.0 0.0 0
MAINT 1920 1.1 0.1 0.0 3172 <-- RMAN
OTHER_GROUPS 1920 1.1 0.1 0.0 17
REPORTING 1920 0.0 0.0 0.0 0
_ORACLE_BACKGROUND_GROUP_ 1920 0.0 0.0 0.0 25
Total Available Used Oracle Throttled
TIME CONSUMER_GROUP_NAME CPU Seconds Oracle Seconds % of Host CPU Time (s) IO_MEGABYTES
------------------- ------------------------------ --------------- -------------- ------------- ---------------- ------------
2013-02-05 07:02:37 ETL 1920 6.2 0.3 5.1 4873
MAINT 1920 15.5 0.8 0.0 65644 <-- RMAN with reports and ETL
OTHER_GROUPS 1920 0.0 0.0 0.0 0
REPORTING 1920 1.6 0.1 0.9 3964
_ORACLE_BACKGROUND_GROUP_ 1920 0.0 0.0 0.0 20
-- etl
BENCHMARK ,INSTNAME ,START ,END , ELAPSED, MBs
----------,---------------,-----------------,-----------------,----------,-------
benchmark ,dbm1 ,05/02/13 07:03:32,05/02/13 07:03:57, 25, 1381
BENCHMARK ,INSTNAME ,START ,END , ELAPSED, MBs
----------,---------------,-----------------,-----------------,----------,-------
benchmark ,dbm1 ,05/02/13 07:03:32,05/02/13 07:03:57, 25, 1381
-- reporting
BENCHMARK ,INSTNAME ,START ,END , ELAPSED, MBs
----------,---------------,-----------------,-----------------,----------,-------
benchmark ,dbm1 ,05/02/13 07:03:34,05/02/13 07:04:10, 36, 959
BENCHMARK ,INSTNAME ,START ,END , ELAPSED, MBs
----------,---------------,-----------------,-----------------,----------,-------
benchmark ,dbm1 ,05/02/13 07:03:34,05/02/13 07:04:10, 36, 959
INTERDATABASE IORM PLAN
-- INTERDATABASE IORM PLAN
#############################################
* do a show parameter db_unique_name across all the databases, this will be the name you'll be putting as a name on the IORM plan
# main commands
alter iormplan dbPlan=( -
(name=dbm, level=1, allocation=60), -
(name=exadb, level=1, allocation=40), -
(name=other, level=2, allocation=100));
alter iormplan active
list iormplan detail
list iormplan attributes objective
alter iormplan objective = auto
# list
dcli -g ~/cell_group -l root 'cellcli -e list iormplan detail'
dcli -g ~/cell_group -l root 'cellcli -e list iormplan attributes objective'
# implement
dcli -g ~/cell_group -l root 'cellcli -e list iormplan detail'
dcli -g ~/cell_group -l root 'cellcli -e alter iormplan dbPlan=\( \(name=dbm, level=1, allocation=60\), \(name=exadb, level=1, allocation=40\), \(name=other, level=2, allocation=100\)\);'
dcli -g ~/cell_group -l root 'cellcli -e list iormplan detail'
dcli -g ~/cell_group -l root 'cellcli -e alter iormplan active'
dcli -g ~/cell_group -l root 'cellcli -e list iormplan detail'
dcli -g ~/cell_group -l root 'cellcli -e alter iormplan objective = low_latency'
dcli -g ~/cell_group -l root 'cellcli -e list iormplan attributes objective'
# revert
dcli -g ~/cell_group -l root 'cellcli -e alter iormplan dbPlan=\"\"'
dcli -g ~/cell_group -l root 'cellcli -e alter iormplan catPlan=\"\"'
dcli -g ~/cell_group -l root 'cellcli -e list iormplan detail'
dcli -g ~/cell_group -l root 'cellcli -e alter iormplan inactive'
dcli -g ~/cell_group -l root 'cellcli -e list iormplan detail'
dcli -g ~/cell_group -l root 'cellcli -e alter iormplan objective=\"\"'
dcli -g ~/cell_group -l root 'cellcli -e list iormplan attributes objective'