Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, imran.

Asked: November 05, 2020 - 12:18 pm UTC

Last updated: November 09, 2020 - 3:45 am UTC

Version: 11g

Viewed 1000+ times

You Asked

Hi Sir,
how can i execute my job schedule only in 6:00am to 7:00pm daily.
some of my schedules run after 5 seconds,some are working after 15 minutes and some are with after 1 hour,i want to execute them only upper mention time.
i am highly waiting of your kind response.

BEGIN DBMS_SCHEDULER.CREATE_JOB(job_name=>'CALLUPDATEPALLETTYPEJOB',
job_type=>'STORED_PROCEDURE',
job_action=>'my_WMS.UPDATE_STOCKTRANSDET_COLUMN',
start_date=>'11-APR-19 12.25.00 PM Asia/Riyadh',
repeat_interval=>'FREQ=MINUTELY; INTERVAL=5',
end_date=>'31-DEC-25 07.00.00 PM Asia/Riyadh',
auto_drop=>FALSE,
enabled=>TRUE,
comments=>'my_JOB');
END;

2-
BEGIN
  DBMS_SCHEDULER.CREATE_JOB (
   job_name           =>  'UPDATE_UPLOADREQUESTSTATS_JOB',
   job_type           =>  'STORED_PROCEDURE',
   job_action         =>  'EVSCOM.CON_UPDATE_UPLOADREQUEST_STATS',
   start_date         =>  '30-OCT-18 12.10.00 PM Asia/Riyadh',
   repeat_interval    =>  'FREQ=SECONDLY; INTERVAL=6', 
   end_date           =>  '31-DEC-25 07.00.00 PM Asia/Riyadh',
   auto_drop          =>   FALSE,
   enabled             =>   TRUE,
   comments           =>  'YANBU JOB');
END;


and Connor said...

I am assuming that "only in 6:00am to 7:00pm daily" means *between* and not *only* 6am and 7am

Simply add a BYHOUR clause to your interval.

FREQ=MINUTELY; INTERVAL=5;BYHOUR=6,7,8,9,10,11,12,13,14,15,16,17,18,19

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

done job scheduler task

imran ahmed, November 08, 2020 - 12:23 pm UTC

thanks a lot sir
Connor McDonald
November 09, 2020 - 3:45 am UTC

glad we could help

More to Explore

Scheduler

All of the database utilities including the Scheduler are explained in the Utilities guide.