I have a scheduled task in Oracle 11g scheduled to run at 12:00 and 17:00 each day. If the first run takes more than five hours, what would happen to the second scheduled run? Would it simply be dropped or is it postponed until after the first is complete? If it is possible to do either, how can I check what is used in my DB?
I've seen the task run unscheduled a while after the first completes, but I'm not sure if there are other people starting it manually or if something else is affecting it.
Best Answer
You can easily test it yourself.
Create a job that runs every minute at 0 seconds, but it takes 80 seconds to complete:
After a few minutes:
As you can see from the difference between
REQ_START_DATE
andACTUAL_START_DATE
(andLOG_DATE
), each consequent run waits for the previous one to complete.This is the simplest configuration, but you can change this behaviour with the
max_run_duration
parameter that allows you to limit the duration of a job (you need to handle the event that's raised by this).Or if you used scheduler windows, jobs could be set to automatically stop when the window closes with the
stop_on_window_close
parameter.