Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to reset next_run_date of a Scheduler job

ozoracleJan 19 2012 — edited Jul 23 2013
Hi,

How can I reset the next_run_date of a job in the Scheduler?

For example, I have a job which is running every 10 seconds. I want to stop it now and let it run again in let's say an hour. I tried changing the start_date and repeate_interval attributes with no luck.

Oracle 10g R1
MyUser@MyDB> SELECT to_char(NEXT_RUN_DATE, 'dd-Mon hh12:mi:SS am tzr') NEXT_RUN_DATE
  2  FROM DBA_SCHEDULER_JOBS
  3  WHERE job_name='TESTME';

NEXT_RUN_DATE
---------------------------------------------------
20-Jan 11:12:00 AM +11:00

MyUser@MyDB> 
MyUser@MyDB> EXEC DBMS_SCHEDULER.DISABLE('TESTME');

PL/SQL procedure successfully completed.

MyUser@MyDB> EXEC DBMS_SCHEDULER.SET_ATTRIBUTE
('TESTME', 'START_DATE',  TO_TIMESTAMP_TZ('20-01-2
011 11:30:00 AM +11','DD-MM-YYYY HH:MI:SS AM TZR'));

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.05
MyUser@MyDB> EXEC DBMS_SCHEDULER.SET_ATTRIBUTE
('TESTME', 'REPEAT_INTERVAL',  'FREQ=SECONDLY; INT
ERVAL=10');

PL/SQL procedure successfully completed.

MyUser@MyDB> EXEC DBMS_SCHEDULER.ENABLE('TESTME');

MyUser@MyDB> SELECT to_char(NEXT_RUN_DATE, 'dd-Mon hh12:mi:SS am tzr') 
NEXT_RUN_DATE
  2  FROM DBA_SCHEDULER_JOBS
  3  WHERE job_name='TESTME';

NEXT_RUN_DATE
---------------------------------------------------
20-Jan 11:12:40 AM +11:00     <-- still running, it doesn't wait till 11:30
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 20 2013
Added on Jan 19 2012
8 comments
24,954 views