Call (800) 766-1884 for Oracle support & training
Free Oracle Tips

Oracle Consulting Support
Oracle Upgrades
Use New Oracle Features
Oracle Replication Support
Oracle Training
Remote Oracle DBA
System Documentation
Oracle Tips
Oracle Performance

Free Oracle Tips



BC Oracle tuning

Oracle training

Oracle support

Remote Oracle



  Oracle Tips by Burleson

Oracle Job Scheduling

Chapter 3 - Time-Based Job Scheduling

Complex Date Rules for Job Execution

  FOR i IN 1 .. p_iterations LOOP
    l_start_ts_str := ‘TO_TIMESTAMP(‘’’ ||
                       TO_CHAR(l_start_ts, ‘DD-MON-YYYY HH24:MI:SS’) ||
                       ‘’’,’’DD-MON-YYYY HH24:MI:SS’’)’;
    l_interval := REPLACE(LOWER(p_interval), ‘systimestamp’,
    EXECUTE IMMEDIATE ‘SELECT ‘ || l_interval || ‘ INTO :return FROM dual’
      INTO l_next_run_ts;
    DBMS_OUTPUT.put_line('Next Run Date: ' || l_next_run_ts);
    l_start_ts := l_next_run_ts;

The best way to come to grips with defining repeat intervals and comparing the different methods available is looking at some examples.  Table 3.11 below lists a range of repeat intervals along with expressions than can be used to achieve them.  The date expressions can be used to schedule jobs using the dbms_job package, while the timestamp and calendar syntax expressions can be used for jobs scheduled using the dbms_scheduler package in Oracle10g.  Where possible, a literal and interval literal example is given along with an example of the output generated by the test procedures.

The above text is an excerpt from:

Oracle Job Scheduling
Creating Robust Task Management with dbms_job and Oracle10g dbms_scheduler

ISBN 0-9744486-6-4

by Dr. Timothy S. Hall

Download your Oracle scripts now:

The definitive Oracle Script collection for every Oracle professional DBA


Oracle performance tuning software 

Oracle performance tuning book


Oracle performance Tuning 10g reference poster
Oracle training in Linux commands
Oracle training Excel
Oracle training & performance tuning books



Copyright © 1996 -  2014 by Burleson. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.