How to skip jobs when duration is longer than expected
466511Jan 19 2010 — edited Jan 22 2010Hi All,
in a datawarehouse environment I have a job which loads the data every hour. The job was created with a repeat interval of "freq=hourly; byminute=00". This has worked fine in the past.
Now I am in a situation where sometimes the job runs longer than 1 hour, e.g. 2.50 hours. When the first job ends the scheduler starts the next hourly job and so on, until it is again "on time".
Let's say the first job starts at 7 in the morning and the duration is 2.5 hours, which means: on 9:30 the 8 o'clock job is startet. This job works for 30 minutes, so on 10 o'clock the 9 o'clock job ist startet and so on until the scheduler catches up again.
I do not want the scheduler to do this, I want the scheduler in such cases to skip the 8 and 9 o'clock job and start the 10 o'clock job.
I can not redefine the schedule in a way like "run every 3 hours" because I can not predict when the job will run longer than 60 minutes. It depends on how many work is on the database and server, it depends on how fast the source is accessible and so on. Most of the jobs run fine, btw.
So, after a lot of reading and research I came up with a repeat_interval like 'trunc ( sysdate + 1/24, 'HH' )' instead of the quite static thing above. The idea was to let the scheduler calculate the next full hour after ending the last job.
I tried this solution, but guess what? The job starts at 2 o'clock, runs for 1.5 hours, the scheduler starts the 3 o'clock job and so on...
As far as I understood the principles I thought the scheduler determines the next run date when it is finished.
So I am stuck right now and be very thankful for every other idea you may have.
Database is 10.2.0.4, it is a simple job (no chain, no event triggering nothing). The job is calling an Oracle Workflow, but this is not the problem.
Regards
Martina