Thursday, October 13, 2016

Modify the default Scheduler Window

resmgr:cpu quantum : This wait event indicate that The session is waiting to be allocated a quantum of cpu. This event occurs when the resource manager is enabled and is throttling CPU consumption. 

Solution : Check the status of Resource manager if it is running stop and configure Scheduler Window as per your idle database time.

SELECT WINDOW_NAME,
 RESOURCE_PLAN,
 ENABLED,
 CAST (LAST_START_DATE AS TIMESTAMP) LAST_START_DATE,
 CAST (NEXT_START_DATE AS TIMESTAMP) NEXT_START_TIME,
   EXTRACT (DAY FROM DURATION) * 24 * 60
 + EXTRACT (HOUR FROM DURATION) * 60
 + EXTRACT (MINUTE FROM DURATION) DURATION,
 ACTIVE,
 COMMENTS
FROM ALL_SCHEDULER_WINDOWS
ORDER BY NEXT_START_DATE;

The output of this query :


It is configured based on US holiday standard but is some different country like Bangladesh holiday is Friday for that we have to modify this default configuration.

To change the default configuration of each window we have to perform the following steps:

1. Disable the window.
2. Set attribute for window.
3. Enable The window.

Example of Sunday Window Change :

BEGIN

BEGIN
DBMS_SCHEDULER.DISABLE(
name=>'"SYS"."SUNDAY_WINDOW"',
force=>TRUE);
END;

BEGIN
DBMS_SCHEDULER.SET_ATTRIBUTE(
name=>'"SYS"."SUNDAY_WINDOW"',
attribute=>'DURATION',
value=>numtodsinterval(240, 'minute'));
END;

BEGIN
DBMS_SCHEDULER.SET_ATTRIBUTE(
name=>'"SYS"."SUNDAY_WINDOW"',
attribute=>'REPEAT_INTERVAL',
value=>'FREQ=WEEKLY;BYDAY=SUN;BYHOUR=1;BYMINUTE=0;BYSECOND=0');
END;

BEGIN
DBMS_SCHEDULER.ENABLE(
name=>'"SYS"."SUNDAY_WINDOW"');
END;

END;

Result after change the default configuration of Sunday window :



No comments:

Post a Comment