Chapter 6. Events
So far, we have mostly used jobs that ran immediately upon being enabled, or when we called the run_job
procedure of the dbms_scheduler
package. Many jobs are time-based; they are controlled by a schedule based on some kind of calendar.
However, not everything in real life can be controlled by a calendar. Many things need an action on an ad hoc basis, depending on the occurrence of some other thing. This is called event-based scheduling. Events also exist as the outcome of a job. We can define a job to raise an event in several ways—when it ends, or when it ends in an error, or when it does not end within the expected runtime. Let's start with creating job events in order to make job monitoring a lot easier for you.
In this chapter, we will see how events that are generated by a job or a chain step can be intercepted to enable the monitoring of jobs. After that, we will see how we can use events to start a job that is waiting for an event.
Monitoring job events
Most of the...