snippetMinor
Oracle dbms_scheduler: Can I create a job that will not overlap with itself?
Viewed 0 times
itselfcancreatewithoverlapwillthatdbms_scheduleroraclenot
Problem
How can I ensure that a dbms_scheduler job will never have more than one instance running?
For example, if I have a job that is scheduled to run once a minute, but it actually runs for three minutes, I don't want a second and third instance of the job to start and run concurrently.
(note) I previously asked this question specifying that either dbms_scheduler or dbms_jobs solutions were acceptable. I have since learned that dbms_jobs does not work well on RAC, hence this dbms_scheduler-specific question. (end note)
For example, if I have a job that is scheduled to run once a minute, but it actually runs for three minutes, I don't want a second and third instance of the job to start and run concurrently.
(note) I previously asked this question specifying that either dbms_scheduler or dbms_jobs solutions were acceptable. I have since learned that dbms_jobs does not work well on RAC, hence this dbms_scheduler-specific question. (end note)
Solution
yes, you can, this in fact is default behaviour. See Database Administrator’s Guide chapter 29 Scheduling Jobs with Oracle Scheduler
Immediately after a job starts, the repeat_interval is evaluated to
determine the next scheduled execution time of the job. While this
might arrive while the job is still running, a new instance of the job
does not start until the current one completes.
Immediately after a job starts, the repeat_interval is evaluated to
determine the next scheduled execution time of the job. While this
might arrive while the job is still running, a new instance of the job
does not start until the current one completes.
Context
StackExchange Database Administrators Q#110758, answer score: 2
Revisions (0)
No revisions yet.