|
Oracle Home |
|
Home > Oracle Database Administration (DBA) > Maintenance > Managing Oracle Database Jobs |
|
Oracle Database 10g Administration (DBA): Maintenance |
|---|
Managing Oracle Database Jobs |
|
All
the time we need some PL/SQL scripts to run at a specific period of time
regularly. This is done by scheduling the database jobs to run following
some rules. A job define what we have to run, when and at which
interval. When a job is created (submitted), the job is put in a queue.
The queue is monitored by a coordinator job queue (CJQ0)
background process. The coordinator (CJQ0) periodically selects
jobs that are ready to run from the jobs shown in the
To create a job we have to use the DBMS_JOB.SUBMIT procedure. declare vnu_job NUMBER; beginDBMS_JOB .SUBMIT (vnu_job,'scott.Procedure_A;', sysdate,'sysdate+3/(24*60)'); end;
In this example, the procedure Procedure_A is scheduled to run at every 3 minutes starting from "sysdate".
begin DBMS_JOB .RUN(vnu_job); end; /This PL/SQL block run the previous job at this moment.
How to change the execution time for a job begin DBMS_JOB .INTERVAL(vnu_job, 'NULL');end; / In this example, the job will not run again after it successfully executes and it will be deleted from the job queue.
How to remove a job from the database
begin DBMS_JOB .REMOVE(vnu_job);end; /
More information about this subject ( Managing Oracle Database Jobs ) you can get from www.in-oracle.com
|
|
Home > Oracle Database Administration (DBA) > Maintenance > Managing Oracle Database Jobs |
|
Different Romanian Links/ Linkuri romanesti diferite |
Disclaimer: The views expressed on this web site are my own and do not reflect the views of Oracle Corporation. You may use the information from this site only at your risk. Copyright (c) 2009-2011 Paul Catalin Tomoiu. All rights reserved.