Query - Evaluating Inteval parameter in DBMS_JOB [message #304190] |
Tue, 04 March 2008 08:23 |
orasaket
Messages: 70 Registered: November 2006
|
Member |
|
|
Hi,
I have a query regarding Oacle 9i dbms_job.
I have Scheduled a job to execute daily at 21:30 with following expression
DBMS_JOB.SUBMIT(
job => :jobno ,
what => 'batch_process_prc;',
next_date => TRUNC(sysdate)+21.50/24,
interval => 'TRUNC(SYSDATE+1)+21.50/24'
);
Now say if the job execution start at 21:30 on Monday and goes beyond 21:30 of tuesday to finish at 22:30 of Tuesday
What will happen to the jobs' 'scheduled execution' on Tuesday?
Will it execute immediately at 22:30 once the execution started on monday finishes?
And what could be concluded about next_date evaluation from it.
Does it happen before job execution starts?Or after Job Execution is completed?
Thanks and Regards,
OraSaket
|
|
|
|
Re: Query - Evaluating Inteval parameter in DBMS_JOB [message #304213 is a reply to message #304190] |
Tue, 04 March 2008 09:57 |
orasaket
Messages: 70 Registered: November 2006
|
Member |
|
|
Michel,
2 things here..
1)
when people ask such things definitely they have some constraints in the environment they are working. Evrything is not available or permitted to everybody, everywhere. Do you agree on this?
2)
It's not silly Scheduling -since a job might not finish executing before its next scheduled run.
E.g. if the batch job I exampled is scheduled to execute at 21:30 on saturday and sunday and it could not complete till Sunday 21:30, because something went too slow in between or some backup started in between etc. etc. nobody will be there to monitor on Sunday evening.
My question was on that context.
Hope it is clear now.
Regards,
OraSaket
|
|
|
|
Re: Query - Evaluating Inteval parameter in DBMS_JOB [message #304316 is a reply to message #304190] |
Tue, 04 March 2008 18:30 |
|
Barbara Boehmer
Messages: 9100 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
The next run date, based on the provided interval, is calculated when the job is run, not when it finishes. So, if you start your job on Monday at 21:30 and your interval is TRUNC(SYSDATE+1)+21.50/24, then your next scheduled job is on Tuesday at 21:30. However, it will not start the next job until the previous job is finished. So, the next job will begin immediately after the previous job is finished at 22:30 on Tuesday, just as you suspected.
|
|
|
|