The DBMS_ JOB package provides a way for you to schedule jobs from within the Oracle RDBMS. A job is a call to a single stored procedure. You can submit a job to run once or on a recurring basis. Once a job has been submitted, you can check on the status of the job by viewing a data dictionary table. You can also change the parameters of the job with the CHANGE procedure. When you submit a job, you must provide a string that describes that job to the DBMS_ JOB package and specify a job execution interval.
The Oracle Server considers a job to be broken if it has tried and failed 16 times to run the job. At this point, Oracle marks the job as broken and will no longer try to run the job until either (a) you mark the job as fixed or (b) you force the job to execute with a call to the RUN procedure. Use the BROKEN procedure to mark the job as fixed and specify the next date on which you want the job to run. The specification is:
PROCEDURE DBMS_JOB.BROKEN (job IN BINARY_INTEGER, broken IN BOOLEAN, next_date IN DATE DEFAULT SYSDATE);
PROCEDURE DBMS_JOB.CHANGE (job IN BINARY_INTEGER, what IN VARCHAR2, next_date IN DATE, interval IN VARCHAR2);
PROCEDURE DBMS_JOB.INTERVAL (job IN BINARY_INTEGER, interval IN VARCHAR2);
The ISUBMIT procedure submits a new job with a specified job number to the queue. The difference between ISUBMIT and SUBMIT (described later in this section) is that ISUBMIT specifies a job number, whereas SUBMIT returns a job number generated by the DBMS_JOB package. The specification is:
PROCEDURE DBMS_JOB.ISUBMIT (job IN BINARY_INTEGER, what IN VARCHAR2, next_date in DATE DEFAULT SYSDATE interval IN VARCHAR2 DEFAULT 'NULL', no_parse in BOOLEAN DEFAULT FALSE);
PROCEDURE DBMS_JOB.NEXT_DATE (job IN BINARY_INTEGER, next_date IN DATE);
PROCEDURE DBMS_JOB.REMOVE (job IN BINARY_INTEGER);
PROCEDURE DBMS_JOB.RUN (job IN BINARY_INTEGER);
PROCEDURE DBMS_JOB.SUBMIT (job OUT BINARY_INTEGER, what IN VARCHAR2, next_date IN DATE DEFAULT SYSDATE, interval IN VARCHAR2 DEFAULT 'NULL', no_parse IN BOOLEAN DEFAULT FALSE);
PROCEDURE DBMS_JOB.USER_EXPORT (job IN BINARY_INTEGER, mycall OUT VARCHAR2);
Copyright (c) 2000 O'Reilly & Associates. All rights reserved.