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

  SELECT name
  INTO   l_db_name
  FROM   v$database;

   CASE l_db_name

    WHEN 'PROD' THEN l_timestamp := p_timestamp + INTERVAL '10' MINUTE;
    WHEN 'TEST' THEN l_timestamp := p_timestamp + INTERVAL '1' HOUR;
    ELSE l_timestamp := p_timestamp + INTERVAL '1' DAY;

  RETURN l_timestamp;

When this script is run against the development environment with a database name of DB10G, the following run schedule is produced:

SQL1> exec test_timestamp_string('my_schedule_function(systimestamp)');
Next Run Date: 02-JAN-2004 03:04:32
Next Run Date: 03-JAN-2004 03:04:32
Next Run Date: 04-JAN-2004 03:04:32
Next Run Date: 05-JAN-2004 03:04:32
Next Run Date: 06-JAN-2004 03:04:32

PL/SQL procedure successfully completed.

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.