My Oracle Support Banner

How to Build up an Event Based Job - An Example (Doc ID 1431664.1)

Last updated on DECEMBER 26, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.1 and later
Information in this document applies to any platform.

Goal

NOTE: In the images and/or the document content below, the user information and environment data used represents fictitious data from the Oracle sample or bulit-in schema(s), Public Documentation delivered with an Oracle database product or other training material.  Any similarity to actual environments, actual persons, living or dead, is purely coincidental and not intended in any manner.

There are two kinds of events:

· Events Raised by the Scheduler:
set up a job so that the Scheduler raises an event when the job changes state. You do so by setting the raise_events job attribute in the SET_ATTRIBUTE procedure. The Scheduler raises events by enqueuing messages to the Scheduler event queue SYS.SCHEDULER$_EVENT_QUEUE. Then the application must subsribe to this event queue and take apropriate actions.

Note: To prevent unlimited growth of the scheduler event queue, events will expire in 24 hours by default.
But this time can be changed with attribute event_expiry_time in procedure SET_SCHEDULER_ATTRIBUTE.

Example: Due to a high system load, a job is not started after 30 min after the scheduled start time. The scheduler can raise an event to send an email notification. (event raised by the scheduler)

· Events Raised by an Application: The Application raises an event to notify the Scheduler to start a job. A job started in this way is called event-based job. Create a schedule that references an event instead of timeframe. Then assign a job to this event schedule . The job runs when the event is raised.

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.