dbTalk Databases Forums  

DBMS_JOB question

comp.database.oracle comp.database.oracle


Discuss DBMS_JOB question in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
col
 
Posts: n/a

Default DBMS_JOB question - 06-07-2004 , 11:59 PM






I want to schedule a job to run on 24th on each month (Jan 24,Feb 24,Mar
24,...).But I noticed that by setting Interval to 'sysdate+30',the 'next run
date' is corrent until February 24, after that the job will run on March 25.
(Assuming the first submitted job is on Jan 24).

any idea?
thanks.



Reply With Quote
  #2  
Old   
Chris Leonard
 
Posts: n/a

Default Re: DBMS_JOB question - 06-08-2004 , 12:36 AM






You should set Interval to something like 'add_months(sysdate, 1)'. Also,
you may notice the time creeping up each time you run, as the Interval
expression may not get evaluated _precisely_ when you expect it to. So (for
example) if you want to run at 1 AM on the 24th of each month, then you
could do something like 'truncate(add_months(sysdate, 1)) + 1/24'. Truncate
will, by default, truncate a date to midnight, and adding 1/24th of a day
back in gets you to 1 AM. Hopefully this is enough to get you going.

--
Cheers,
Chris

___________________________________

Chris Leonard, The Database Guy
http://www.databaseguy.com

Brainbench MVP for Oracle Admin
http://www.brainbench.com

MCSE, MCDBA, OCP, CIW
___________________________________

"col" <colx (AT) hotmail (DOT) com> wrote

Quote:
I want to schedule a job to run on 24th on each month (Jan 24,Feb 24,Mar
24,...).But I noticed that by setting Interval to 'sysdate+30',the 'next
run
date' is corrent until February 24, after that the job will run on March
25.
(Assuming the first submitted job is on Jan 24).

any idea?
thanks.





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.