RE: dbms_scheduler - run same job at different times

From: Jeff Chirco <JChirco_at_innout.com>
Date: Fri, 26 Aug 2011 18:19:38 +0000
Message-ID: <6D9F00643B733E489E419CB485C9662710E453_at_IRVMBX01.innout.corp>



Ok thank you. I think that worked.

Jeff

-----Original Message-----
From: Dunbar, Norman (Capgemini) [mailto:norman.dunbar.capgemini_at_environment-agency.gov.uk] Sent: Friday, August 26, 2011 12:05 AM
To: Jeff Chirco; Morten Egan
Cc: oracle-l_at_freelists.org
Subject: RE: dbms_scheduler - run same job at different times

Morning,

>> I did that following this method but it doesn't work right.
>> The job runs at 730, 930, and 1230 instead of 7, 930, and 12. Why
>> would it do that?

Because you created the LOAD_1 schedule at a time of day when to_char(sysdate,'MI') returned '30'. :-)

I just - at 07:39 created a LOAD_1 schedule and In Toad, extracted the next 10 scheduled run times, they were all at 7:39 and 12:39. This propagates through to the LOAD_MAIN schedule.

Do this to fix it:

dbms_scheduler.create_schedule('LOAD_1', repeat_interval =>

   'FREQ=DAILY;BYHOUR=7,12; BYMINUTE=0'); END; / Add a BYMINUTE to the schedule, or alternatively, use the startdate parameter to set a starting date that include '00' as the minutes. And it's a timestamp not a date, just for added fun. (I hate timestamps, especially those with timezones - as this is!)

HTH Cheers,
Norm.

PS. Yesterday was the first time ever I had to create a schedule (!!!) and I had exactly the same problem you did - the minutes was all over the place until I realised that it reflected the fact that the default start time appears to be systimestamp. So the minutes and seconds part is simply defaulted to the time that the schedule was created. I found that by adding either a startdate or a BYMINUTE, I got it to run on the hour as required - but there's not much I can do about the seconds - unless I use a startdate with zero seconds.

PPS. This might be useful <URL:
http://www.packtpub.com/mastering-oracle-scheduler-in-oracle-11g-databas es/book

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it. We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at www.environment-agency.gov.uk

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Aug 26 2011 - 13:19:38 CDT

Original text of this message