Oracle7 Server Distributed Systems Volume II: Replicated Data
Forcing a Job to Be Executed
There may be times when you would like to manually execute a job. For example, if you have fixed a broken job, you may want to test the job immediately by forcing it to execute.
To force a job to be executed immediately, use the procedure RUN in the DBMS_JOB package. Oracle attempts to run the job, even if the job is marked as broken.
When you run a job using DBMS_JOB.RUN, Oracle recomputes the next execution date. For example, if you create a job on a Monday with a NEXT_DATE value of 'SYSDATE' and an INTERVAL value of 'SYSDATE + 7', the job is run every seven days starting on Monday. However, if you execute RUN on Wednesday, the next execution date will be the next Wednesday.
Forcing a Job to be Executed: Example
The following example runs job 14144 in your session and recomputes the next execution date:
DBMS_JOB.RUN( job => 14144);
Restrictions
You can run only jobs that you own. If you try to run a job that you do not own, you receive a message that states the job is not in the job queue.
The procedure RUN contains an implicit commit. Once you execute a job using RUN, you cannot rollback.
Running Broken Jobs
When you run a job that has been marked as broken and the job completes successfully, Oracle relabels the job as not broken. Oracle also resets its count of the number of failed executions for the job.
For more information about viewing the number of failures for a job and its status, see "Viewing Job Queue Information" .
Additional Information: The parameters for the procedure DBMS_JOB.RUN are described in Table 12 - 35.