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




Scheduling a Job
Oracle Tips by Burleson

Now let’s look at an example of scheduling a typical job using the DBMS_Job package. Assume that we have an Hourly_Tracking() procedure that we want to run every hour. We schedule this procedure to be run using a call to the Submit() procedure, as follows:

DBMS_Job.Submit (job       => biJobNumber,
                 what      => 'Hourly_Tracking;',
                 next_date => SYSDATE,
                 interval  => 'SYSDATE + 1/24',
                 no_parse  => FALSE);

This call schedules a job that will be executed immediately and then every hour on the hour. The string passed to the interval parameter equates to “the current date and time plus 1 day divided by 24.”

If an error occurs while the Hourly_Tracking() procedure is executing, the procedure will halt, and the job will be marked as broken. To restart the job, call the Broken() procedure, as follows:

DBMS_Job.Broken (job       => biJobNumber,
                 broken    => FALSE,
                 next_date => SYSDATE);

By passing FALSE for the broken parameter, the job is marked as unbroken and will be executed again at the specified next_date.

At the end of the day, we want to stop the hourly execution of the procedure before beginning our nightly backups. This is accomplished by calling the Remove() procedure, as follows:

DBMS_Job.Remove (job => biJobNumber);


The DBMS_Output package is more familiar to PL/SQL developers than any other package provided by Oracle. The routines contained in this package are often used when debugging stored PL/SQL objects. Consequently, this package is discussed in Chapter 8.

This is an excerpt from the book "High Performance Oracle Database Automation" by Jonathan Ingram and Donald K. Burleson, Series Editor.


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. 

Hit Counter