The
dbms_scheduler package allows you to create jobs that
run at scheduled time periods, and you can get quite sophisticated
in job scheduling dates. See these examples of
complex job scheduling with dbms_scheduler.
Also see these
examples of complex date range using sysdate and interval, and see
Dr. Tim Hall's book "Oracle
Job Scheduling" for complete details on advanced job scheduling
with
dbms_scheduler.
An experienced DBA knows the internals
of the Oracle packages and this knowledge allows them to develop novel uses for existing
tools. The mark of a real Oracle guru is being able to
use tools in ways that they were not designed, like deploying
multiple blocksizes for high performance in very large OLTP
databases.
For another creative example, we see where David
Aldridge has this outstanding article on using the
dbms_scheduler evaluate_calendar_string procedure to
generate a list of dates from Oracle.
This
is a
very creative and novel use of the dbms_scheduler package
because dbms_scheduler was not originally designed to
generate date lists.
Using his list_of_dates
function, you can create complex data generations including lists of
holidays:
-- List of weekdays
excluding public holidays
select *
from table(
list_of_dates(
'WEEKDAYS;EXCLUDE=PUBLIC_HOLIDAYS',
sysdate ,
null));
-- List of weekend and
public holiday dates
select *
from table(
list_of_dates(
'WEEKENDS,PUBLIC_HOLIDAYS',
sysdate ,
null));