Database Reference
In-Depth Information
CHAPTER 19
■ ■ ■
DBMS_SCHEDULER
T he database scheduler is an advanced job scheduling capability built into Oracle10 g and
subsequent releases. The package DBMS_SCHEDULER is the interface to the job scheduler. It is
extensively documented in the Oracle Database Administrator's Guide and the PL/SQL Pack-
ages and Types Reference . The database scheduler supports jobs that run inside the DBMS as
well as jobs that run outside of the DBMS at operating system level. The latter type of job is
termed an external job. Important aspects concerning the execution of external jobs, such as
exit code handling, removal of environment variables, details of program argument passing,
requirements to run external programs owned by users other than SYS, and default privileges
of external jobs defined by the configuration file externaljob.ora are undocumented.
This chapter provides all the details on the subject of external jobs: how they are run,
which environment variables and privileges are available to them, how to signal success and
failure, and how to integrate custom logging with the scheduler's own logging.
Running External Jobs with
the Database Scheduler
The database scheduler is an advanced job scheduling capability that ships with Oracle10 g and
subsequent releases. The PL/SQL package DBMS_SCHEDULER is the interface to a rich set of job
scheduling features. Oracle10 g Release 1 was the first ORACLE DBMS release with the capability
to run jobs outside of the database. The scheduler supports three types of jobs:
￿
Stored procedures
￿
PL/SQL blocks
￿
Executables, i.e., external programs that run outside of the database engine
Job chains are another new feature introduced with Oracle10 g . Chains consist of several
jobs. Rules are used to decide which job within a chain to execute next. Since the scheduler
supports jobs that run within as well as outside of the database engine, it makes sense to use it
for controlling complex processing that involves job steps at operating system level as well as
within the database. Another option for running jobs at operating system level is the Enterprise
Manager job system. In my own experience, the database scheduler has worked flawlessly, whereas
I witnessed several failures of the Enterprise Manager job system. Hence I recommend using
the database scheduler in favor of the Enterprise Manager job system. Enterprise Manager
181
 
Search WWH ::




Custom Search