November 19, 2012

JOBS


Scheduler jobs

set lines 300 pages 100
col JOB_ACTION for a50
select job_name, owner,job_action,state,NEXT_RUN_DATE from dba_scheduler_jobs;

enable a broken job
(use this to enable job in a schema, if you want to enable job of different schema, use dbms_ijob)

exec dbms_job.broken(JOB=>43, NEXT_DATE=>'SYSDATE + 1', broken=>FALSE);
exec dbms_job.broken(JOB=>43, NEXT_DATE=>TO_DATE('09-JUN-11 12:30 AM','DD-MON-YY HH:MI AM'), broken=>FALSE);

Breaking a job

dbms_ijob.broken(<job_number>, Boolean);

change interval of a job

exec dbms_job.next_date(83,TO_DATE('14-JUL-11 12:30 AM','DD-MON-YY HH:Mi PM'));
exec dbms_job.interval(83,'SYSDATE + 1');

disable a job

exec dbms_scheduler.disable('AUTO_SPACE_ADVISOR_JOB');

drop job

exec dbms_scheduler.drop_job('ADV_SEGMENTADV_7420699');

No comments:

Post a Comment