Posted 3/5/2009 10:52:50 AM
|
|
|
|
There are times when you will need to update your windows based on business requirements or simply because your process takes longer then the default weeknight and weekend scheduler window. Here are some guidelines to use for creating and updating scheduler activities.
To create a window, use the CREATE_WINDOW procedure. The following statement illustrates an example of creating a window:
BEGIN
DBMS_SCHEDULER.CREATE_WINDOW (
window_name => 'CUSTOM_WINDOW',
resource_plan => 'HI_RESOURCE1',
start_date => '15-JAN-09 01.00.00 AM',
repeat_interval => 'FREQ=DAILY',
end_date => '15-SEP-09 01.00.00 AM',
duration => interval '60' minute,
window_priority => 'HIGH',
comments => 'This is my custom window.');
END;
/
There are default windows already created in the system. If you would like to make changes to the attributes to the default windows, here are the steps:
Default window names are: WEEKNIGHT_WINDOW and WEEKEND_WINDOW:
This will change the WEEKNIGHT_WINDOW to run M-F starting at 5pm (17hours). It will also run for 600 Minutes or 10 hours.
EXECUTE DBMS_SCHEDULER.SET_ATTRIBUTE('WEEKNIGHT_WINDOW', 'repeat_interval', 'freq=daily;byday=MON, TUE, WED, THU, FRI;byhour=17;byminute=0;bysecond=0');
EXECUTE DBMS_SCHEDULER.SET_ATTRIBUTE('WEEKNIGHT_WINDOW', 'duration', interval '600' minute);
This will change the WEEKEND_WINDOW to run from Friday - Sunday (5pm to 3AM) (10 Hours)
EXECUTE DBMS_SCHEDULER.SET_ATTRIBUTE('WEEKEND_WINDOW', 'repeat_interval', 'freq=daily;byday=FRI, SAT, SUN;byhour=17;byminute=0;bysecond=0');
EXECUTE DBMS_SCHEDULER.SET_ATTRIBUTE('WEEKEND_WINDOW', 'duration', interval '600' minute);
You can see the updated schedule by querying this view:
select * from dba_scheduler_windows
where window_name in ('WEEKNIGHT_WINDOW','WEEKEND_WINDOW');
|
|
|
|