Home » SQL & PL/SQL » SQL & PL/SQL » A SIMPLE QUERY ABOUT ORACLE JOBS
A SIMPLE QUERY ABOUT ORACLE JOBS [message #332666] Wed, 09 July 2008 05:50 Go to next message
kashifchughtai
Messages: 113
Registered: October 2007
Senior Member
Can any tell me how a job's next run is calculated. and is it calculated after finishing the job?

if i have one job running after every one hour and if jobs takes more then one hour what will happend?
Re: A SIMPLE QUERY ABOUT ORACLE JOBS [message #332671 is a reply to message #332666] Wed, 09 July 2008 06:06 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
When a job finished running, it calculates it's next run date based on the INTERVAL value that was supplied when the job was created.

If your job runs at the end of every hour, and takes longer than an hour to run, then it will run again at the end of the hour in which it finished - ie it will skip one run.
Re: A SIMPLE QUERY ABOUT ORACLE JOBS [message #332673 is a reply to message #332671] Wed, 09 July 2008 06:10 Go to previous messageGo to next message
kashifchughtai
Messages: 113
Registered: October 2007
Senior Member
thankx alot Smile

Is there anyway to keep job running after one hour. but for some specific time like in night from 12AM to 6AM just runs only once.?

Do we need to break the job in this case?
Re: A SIMPLE QUERY ABOUT ORACLE JOBS [message #332678 is a reply to message #332673] Wed, 09 July 2008 06:26 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
USe a CASE statement in the INTERVAL clause.
Somthing like:
case when to_number(to_char(trunc(sysdate,'HH'),'HH24')) between 0 and 6 then trunc(sysdate) + 6/24
            else trunc(sysdate,'HH') + 1/24
            end
Re: A SIMPLE QUERY ABOUT ORACLE JOBS [message #332679 is a reply to message #332666] Wed, 09 July 2008 06:27 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Don't put your title in UPPER case.

Regards
Michel
Re: A SIMPLE QUERY ABOUT ORACLE JOBS [message #332706 is a reply to message #332679] Wed, 09 July 2008 07:16 Go to previous message
kashifchughtai
Messages: 113
Registered: October 2007
Senior Member
okkkkkkkkkkkkkkk n thankx again JRowbottom
Previous Topic: Insert Records
Next Topic: Error : ORA-01410: invalid ROWID while executing a package
Goto Forum:
  


Current Time: Wed Dec 07 22:31:25 CST 2016

Total time taken to generate the page: 0.16127 seconds