Oracle Tips by Mike Ault
The DBMS_JOB Package
An example using the SUBMIT procedure would be:
DBMS_JOB.SUBMIT(:x,’BEGIN testit; END;’,SYSDATE,’SYSDATE+(15/1440)’);
In the first example, the job would be created
and assigned the job number 999. The advantage to this form of
submission is that it allows the Remote DBA to specify the job number so
that for future work with the specific job, the number is already
known. In the second example, the job receives a job number from an
internal queue which then requires either reading and recording the
“x” variable or looking at the Remote DBA_JOBS view to find the job number
for a specific “WHAT”.
To run a job immediately you use the
DBMS_JOB.RUN procedure specifying the job number for the specific
job. To remove a procedure you use the DBMS_JOB.REMOVE procedure
specifying the job number of the job to be removed. You cannot
remove a running job.
SEE CODE DEPOT FOR FULL SCRIPTS
For more information on this topic, I recommend Don
Burleson's latest book "Oracle
Tuning: The Definitive Reference".
You can buy it direct from the publisher for 50%-off and get
instant access to the code depot of Oracle tuning scripts:
Expert Remote DBA
BC is America's oldest and largest Remote DBA Oracle support
provider. Get real Remote DBA experts, call
BC Remote DBA today.