I need to create schedule for run jobs in oracle. It'll run at first workday of month, but excluding holidays. When first workday of month is holiday, than run should be next workday after holiday.
I managed with first workday of each month and exclude holidays, but I don't know how to set run on workday after holiday...
HOLIDAYS
DBMS_SCHEDULER.CREATE_SCHEDULE (
schedule_name => 'SCHDL_COM_HOLIDAYS',
repeat_interval => 'FREQ=YEARLY; BYDATE=0101,0111;'
);
FIRST WORKDAY
DBMS_SCHEDULER.CREATE_SCHEDULE (
schedule_name => 'SCHDL_FIRST_WD',
repeat_interval => 'FREQ=MONTHLY; BYDAY=MON,TUE,WED,THU,FRI; EXCLUDE=SCHDL_COM_HOLIDAYS; BYSETPOS=1'
);
Please follow the below steps:
1) Create schedule for all the holidays.
2) Create a schedule which clubs all the schedule created above.
3) Create a job, note the “EXCLUDE” and “BYSETPOS” option