syntax of calendar dbms_scheduler (repeat_interval)

Hello
I planned my logon work using dbms_scheduler.
atually that my work as a planner is to make, it checks before logon users who had access to the content of the particular schema and dbms_scheduler job will send mail to the DBA team.
In fact in my job scheduler it send mail to dba of the LUN to Sam every day.
But here's my task
(* 1) how to limit sending of mail only on "the second and the third Saturday of each month."? *
(* 2) work Monday the Scheduler will check that the day previous IE sunday(sysdate-1). But how do we change work Monday to be checking the previous business day and holidays (i.e., friday + holidays (sat, sund).? *)
(* 3) how to limit sending at the request of mail on "days on public HOLIDAYS? *

For more information, here below, I post my calendar to go program:

BEGIN
() DBMS_SCHEDULER.create_schedule
schedule_name = > "test_daily_schedule"
start_date = > SYSTIMESTAMP,
repeat_interval = > ' freq = daily; byday = MON, TUE, WED, THU, FRI, SAT; byhour = 10; byminute = 5',
End_date = > NULL,
Comments = > "Repeats every day, at the time, forever.");
END;
/

Looking for useful answers
Thanks in advance.
Advertisement

First create a vacation calendar.
See below for a schedule that defines every day (branch closed)
Then create you a schedule for weekends + holidays say "closed."
For a work to be done 1 day after a day of closure, you can use the calendar 'freq = all days; "intersect = closed + offset: 1 d.
However, that would go on the second consecutive day of closed so schedule.
This is corrected by adding an exclude = closed to the schedule clause.
Another problem is that the previous day is not a business day.
To resolve this problem, you can select the last hour for beginning
the work. So instead of sysdate-1, you use something like
Select last_start_date in the user_scheduler_jobs where job_name = JOB_NAME.
JOB_NAME is an argument of meta.

Second and third Saturday is FREQ = MONTHLY; BYDAY = 2SAT, 3SAT.

Example of holiday.

Start
dbms_scheduler.create_schedule (schedule_name-online 'NYD_FRI',
repeat_interval => ' FREQ = YEAR; BYDATE = 1231; BYDAY = FRI ',
comments => ' alternative on Friday for the new year "s day ');
dbms_scheduler.create_schedule (schedule_name-online 'NYD_MON',
repeat_interval => ' FREQ = YEAR; BYDATE = 0102; BYDAY = MY ',.
comments => ' alternative Monday for the new year "s day ');
dbms_scheduler.create_schedule (schedule_name-online 'NewYearsDay',
repeat_interval => ' FREQ = YEAR; BYDATE = 0101; BYDAY IS MON, MAR, SEA, GAME, FRI.; »
|| "(INCLURE = NYD_FRI, NYD_MON', observations => ' nouvel an '' s jour ');"
dbms_scheduler.create_schedule (schedule_name-online 'MartinLutherKing',
repeat_interval => ' FREQ = MONTHLY; INFECTION = JAN; BYDAY = 3 MONTHS ',
Comments => "Martin Luther King Day");
dbms_scheduler.create_schedule (schedule_name-online 'PresidentsDay',
repeat_interval => ' FREQ = MONTHLY; INFECTION = FEB; BYDAY = 3 MONTHS ',
comments => ' President "s day ');
dbms_scheduler.create_schedule (schedule_name-online 'MemorialDay',
repeat_interval => ' FREQ = MONTHLY; INFECTION = MAY; BYDAY =-1MON',.
Comments => "Memorial Day");
dbms_scheduler.create_schedule (schedule_name-online 'ID_FRI',
repeat_interval => ' FREQ = YEAR; BYDATE = 0703; BYDAY = FRI ',
Comments => "Alternative on Friday for the independence day");
dbms_scheduler.create_schedule (schedule_name-online 'ID_MON',
repeat_interval => ' FREQ = YEAR; BYDATE = 0705; BYDAY = MY ',.
Comments => "Alternative Monday for the independence day");
dbms_scheduler.create_schedule (schedule_name-online 'IndependenceDay',
repeat_interval => ' FREQ = YEAR; BYDATE = 0704; BYDAY IS MON, MAR, SEA, GAME, FRI.; »
|| ' INCLUDE = ID_FRI, ID_MON', comments-online 'Independence Day');
dbms_scheduler.create_schedule (schedule_name-online "LaborDay",
repeat_interval => ' FREQ = MONTHLY; INFECTION = MS; BYDAY = 1MON',.
Comments => 'Labor Day');
dbms_scheduler.create_schedule (schedule_name-online 'ColumbusDay',
repeat_interval => ' FREQ = MONTHLY; INFECTION = OCT; BYDAY = 2MON',.
Comments => "Columbus Day");
dbms_scheduler.create_schedule (schedule_name-online 'VD_FRI',
repeat_interval => ' FREQ = YEAR; BYDATE = 1110; BYDAY = FRI ',
Comments => "Alternative Friday for Veterans Day");
dbms_scheduler.create_schedule (schedule_name-online 'VD_MON',
repeat_interval => ' FREQ = YEAR; BYDATE = 1112; BYDAY = MY ',.
Comments => "Alternative Monday for Veterans Day");
dbms_scheduler.create_schedule (schedule_name-online 'VeteransDay',
repeat_interval => ' FREQ = YEAR; BYDATE = 1111; BYDAY IS MON, MAR, SEA, GAME, FRI.; »
|| ' INCLUDE = VD_FRI, VD_MON', comments-online 'Veterans Day');
dbms_scheduler.create_schedule (schedule_name-online 'Action of graces',
repeat_interval => ' FREQ = MONTHLY; INFECTION = NOV; BYDAY = 4THU',.
Comments => "Thanksgiving");
dbms_scheduler.create_schedule (schedule_name-online 'XMS_FRI',
repeat_interval => ' FREQ = YEAR; BYDATE = 1224; BYDAY = FRI ',
Comments => "Alternative Friday for Christmas");
dbms_scheduler.create_schedule (schedule_name-online 'XMS_MON',
repeat_interval => ' FREQ = YEAR; BYDATE = 1226; BYDAY = MY ',.
Comments => "Alternative Monday for Christmas");
dbms_scheduler.create_schedule (schedule_name-online 'Christmas',
repeat_interval => ' FREQ = YEAR; BYDATE = 1225; BYDAY IS MON, MAR, SEA, GAME, FRI.; »
|| ' INCLUDE = XMS_FRI, XMS_MON', comments-online 'Christmas');
end;
/

Start
dbms_scheduler.create_schedule (schedule_name-online 'FederalHolidays',
repeat_interval-online 'NewYearsDay, MartinLutherKing, PresidentsDay,' |
"MemorialDay, IndependenceDay, LaborDay, ColumbusDay, VeteransDay, |
"Thanksgiving, Christmas, comments =>"Federal holidays");
end;
/

Start
dbms_scheduler.create_schedule (schedule_name-online 'Week',
repeat_interval => ' FREQ = DAILY; BYDAY = MON, FRI, MAR, SEA, GAME '.
Comments => "Week schedule based on MON - Fri");
end;
/

Start
dbms_scheduler.create_schedule (schedule_name-online "Working days",
repeat_interval => ' weekdays; EXCLUDE = ' FederalHolidays,
Comments-online "Working days based on the days of the week - Federal holidays");
end;
/

Tags: Database

Similar Questions

Maybe you are looking for