The DBMS_SCHEDULER package is used to manage scheduled tasks. It provides a set of functions and procedures that can be called from PL/SQL programs.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support it.
Privilege requirements
The privileges on the objects of the DBMS_SCHEDULER package must be directly granted to users. Privileges on Scheduler objects (such as jobs) granted through roles are not recognized.
Only SYS can perform operations on objects in the SYS schema.
Considerations
Some procedures in the DBMS_SCHEDULER package support a list of object names separated by commas. If an error occurs for any object in the provided list, the Scheduler will stop processing the list at the first object that returns an error and will not execute the remaining tasks in the list.
When executing the DBMS_SCHEDULER package, if an object does not exist, a PL/SQL exception is returned.
Subprograms of DBMS_SCHEDULER
The following table lists the DBMS_SCHEDULER subprograms supported in the current version of OceanBase Database and their brief descriptions.
| Subprogram | Description |
|---|---|
| CREATE_JOB | Creates a job. |
| CREATE_JOB_CLASS | Creates a job class log. |
| CREATE_PROGRAM | Creates a program. |
| DEFINE_PROGRAM_ARGUMENT | Defines a program argument, whose value can be passed as a string literal to the program. |
| DISABLE | Disables programs, jobs, and other objects. |
| DROP_JOB | Drops a job or all jobs in a job class. |
| DROP_PROGRAM | Drops a program. |
| DROP_JOB_CLASS | Drops a job class log. |
| ENABLE | Enables programs, jobs, and other objects. |
| GENERATE_JOB_NAME | Generates a unique name for a job. |
| PURGE_LOG | Clears job logs. |
| RUN_JOB | Executes a job immediately. |
| SET_ATTRIBUTE | Modifies the attributes of a job, program, or other Scheduler object. |
| SET_JOB_ARGUMENT_VALUE | Sets the value of a job argument. |
| STOP_JOB | Terminates a running job. |
