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


 

HTML Text

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

  l_next_run_date      DATE;
  l_start_date_str     VARCHAR2(100);
BEGIN
  FOR i IN 1 .. p_iterations LOOP
    l_start_date_str := ‘TO_DATE(‘’’ ||
                         TO_CHAR(l_start_date, ‘DD-MON-YYYY HH24:MI:SS’)
||
                         ‘’’,’’DD-MON-YYYY HH24:MI:SS’’)’;
    l_interval := REPLACE(LOWER(p_interval), ‘sysdate’, l_start_date_str);
    EXECUTE IMMEDIATE ‘SELECT ‘ || l_interval || ‘ INTO :return FROM dual’
      INTO l_next_run_date;
   
    DBMS_OUTPUT.put_line('Next Run Date: ' || l_next_run_date);
    l_start_date := l_next_run_date;
  END LOOP;
END;
/

The test_timestamp_string procedure listed below is a copy of the test_date_string procedure that has been adjusted to work with timestamps.


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
 

http://www.rampant-books.com/book_2005_1_scheduling.htm


Download your Oracle scripts now:

www.oracle-script.com

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.