Oracle Scheduler Interface Overview
The product now includes REST services that lets users manage Oracle Scheduler objects using product services. This interface makes it easier to integrate batch schedules with enterprise schedulers.
These are a set of services (invoked through REST APIs) to create, update, read, delete and execute Oracle Scheduler objects. These services are managed within the product itself. These services internally invoke necessary Oracle Scheduler functions to manage and monitor schedules and batch executions.
Following set of OUAF business services can be invoked using REST to manage Oracle scheduler objects: (detailed interface definition is mentioned in Oracle Scheduler – REST APIs).
F1-DBMSProgram - Add, read, change, or deletes a DBMS Scheduler Program object based on the action provided.
F1-DBMSChain - Add, read, change, or deletes a DBMS Scheduler Chain object based on the action provided.
F1-DBMSSchedule - Add, read, change, or deletes a DBMS Scheduler Schedule object based on the action provided.
F1-DBMSJob - Add, read, change, or delete a DBMS Scheduler Job object based on the action provided.
F1-DBMSList - Retrieves a list of names and descriptions of scheduler object based on the type provided and an optional name to filter with.
F1-DBMSSubmitJob - Submits a scheduler job for execution.
F1-DBMSGetJobDetails - Retrieves the details of DBMS Scheduler Job based on job name.
F1-GetDBMSJobs - Retrieves a list of scheduler jobs based on status. The output is either a list of running jobs or a list of completed jobs based on the status provided.
F1-DBMSCancelJob - Uses the service defined above to cancel a DBMS Scheduler Job.
F1-DBMSRestartThread - Uses the service defined above to restart a batch job thread.
F1-DBMSRestartChain - Uses the service defined above to restart DBMS Scheduler Chain.
In addition to the above, the product includes interfaces to allow Oracle Scheduler to schedule and execute product batch processes.
The components of interface are as follows:
A set of tables to configure and control the interface. These tables are not managed by any object within the product itself as they are exclusively reserved for internal use by the Scheduler interface. These are installed in the product schema.
A PL/SQL procedure (Oracle Scheduler Interface (OUAF_BATCH)) that implements an interface to Oracle Scheduler to populate the scheduler interface tables, execute jobs and manage jobs from the PL/SQL interface supported by the Oracle Scheduler. This is installed on the product schema.
The scheduler object may exist on the same database as the product or remotely on a scheduler database. If the remote option is used then the Oracle Scheduler Agent must be installed and enabled on the product database servers. A destination and credentials must also be configured.
Note: The Oracle Scheduler Agent is an option on the database installation or the Oracle Client installation.
If File Watchers are used on product software hosts, then the Oracle Scheduler Agent must be enabled to access the files on the hosts holding the file.
No user interface components are supplied with the interface from the product itself. The Oracle Scheduler uses Oracle SQL Developer or Oracle Enterprise Manager to maintain, execute and monitor Oracle Scheduler objects. It is recommended customers and partners use those interfaces to manage your schedule and related objects for Oracle Scheduler.
For the Oracle Scheduler Interface to operate at least one threadpool.
The Oracle Scheduler interface must be installed on the product schema but the schedule can be maintained locally or remotely. To support remote invocations, it is highly recommended to set up a dedicated database user for the schedule which is independent of the product database users. The product installation guide uses the default SCHADM for this role. All schedule information is stored in this schema not the product schema.
Note: This manual will use the default value for this schedule administrator SCHADM but the actual implementation may vary.
Oracle Scheduler Configuration
The Oracle Scheduler interface is installed on the product database and optionally on the scheduler database (for enterprise wide deployments).
After the Oracle Scheduler interface is installed the scheduler interface operates on the following principles:
The Oracle database holding the schedule must have the JOB_QUEUE_PROCESSES (The default is set to 1000 jobs, unless altered.) set to the maximum number of total concurrent threads (This includes any DBA tasks and non-product processes that use the Oracle Scheduler at any time) expected to execute at peak times to ensure maximum thread usage.
The Oracle Scheduler and interface are configured to define the preferences to set the behavior:
The Oracle Scheduler preferences are configured with global scheduling defaults including email servers, time zones etc. For more information on the Oracle Scheduler preferences refer to Setting Scheduler Preferences and Order of Preference.
The Oracle Scheduler Interface options are set appropriately. For more information refer to Scheduler Interface Options.
The Oracle Scheduler is configured with the following minimal schedule objects. Additional objects can be configured as outlined in Scheduling Jobs with Oracle Scheduler and Using Additional Objects in Oracle Scheduler.
Job - Define one or more jobs per Batch Control using the submit_job interface. Refer to Defining Jobs for additional interface advice.
Chain - Define the dependency chain with all the jobs that need to be executed with that chain. Refer to Defining Chains for additional advice.
Optionally, populate the parameters of the each job as outlined in Specifying Job Parameters.
Oracle Scheduler Execution
Note: The threadpools used by any process must be started before any job can execute.
Note: Refer to the Scheduler Architecture of how the Oracle Scheduler internally operates.
Once the scheduler objects are defined the Oracle Scheduler will initiate the batch jobs using the following technique:
When a job in the Scheduler is deemed ready to execute, the Oracle Scheduler Interface determines the parameters from the various objects (including from the PL/SQL command line) and creates entries in the batch instance tables.
The product batch daemon detects a pending process and distributes the job to the threadpools indicated on the job parameters for execution. The Oracle Scheduler does not distribute the jobs to the threadpools, that is done through the daemon.
During execution the monitoring capabilities in Oracle Scheduler, Oracle Enterprise Manager, JMX or the Batch Run Tree can be used to monitor the process. Refer to Monitoring Oracle Scheduler for more information.
If the batch process fails, the interface set the job to the FAILED state for the Oracle Scheduler to react accordingly. If the batch process completes successfully the interface will set the job to the SUCCEEDED state for the Oracle Scheduler to react accordingly.
The following figure summarizes the flow and processing for the Oracle Scheduler, the Oracle Scheduler Interface and batch architecture:Diagram that shows the structure of the Oracle Scheduler Interface.