The DBMS_SCHEDULER package manages scheduled jobs. The package provides a group of functions and procedures that you can call by using a procedural language (PL) program.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Privileges
You must directly grant the object privileges of the DBMS_SCHEDULER package to a user. If you grant privileges on scheduler objects such as jobs by using roles, the privileges cannot be recognized.
Only SYS users can perform operations on objects in SYS schemas.
Considerations
Some procedures in the DBMS_SCHEDULER package support a list of object names separated with commas (,). If an object in the specified list returns an error during execution, the Scheduler stops executing the object and does not perform the required tasks for subsequent objects in the list.
During the execution of the DBMS_SCHEDULER package, a PL exception is returned if an object does not exist.
Subprograms
The following table describes the DBMS_SCHEDULER subprograms supported by the current OceanBase Database version.
| Subprogram | Description |
|---|---|
| CREATE_JOB | Creates a job. |
| CREATE_PROGRAM | Creates a program. |
| DEFINE_PROGRAM_ARGUMENT | Defines a program argument whose value can be passed to a program as a string literal. |
| DISABLE | Disables a program or job. |
| DROP_JOB | Drops a job or all jobs in a job class. |
| DROP_PROGRAM | Drops a program. |
| ENABLE | Enables a program or job. |
| GENERATE_JOB_NAME | Generates a unique name for a job. |
| RUN_JOB | Immediately executes a job. |
| SET_ATTRIBUTE | Changes the attributes of a job, program, or another Scheduler object. |
| SET_JOB_ARGUMENT_VALUE | Sets a value for a job argument. |