The DBMS_SCHEDULER system package is used to manage scheduled tasks. It provides a set of functions and procedures that users can call from PL programs.
Applicability
This content applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL-compatible mode.
DBMS_SCHEDULER Privileges
Object privileges on the DBMS_SCHEDULER system package must be granted directly to users. Privileges granted to a scheduler object (such as a job) through a role are not recognized.
Only SYS can perform operations on objects in the SYS schema.
Usage instructions
Some procedures in the DBMS_SCHEDULER system package support a comma-separated list of object names. If an error is returned for any object in the provided name list, the Scheduler stops executing the list at the first erroneous object and does not proceed to perform the tasks required by the remaining objects in the list.
When the DBMS_SCHEDULER system package is executed, if an object does not exist, it returns a PL exception.
Overview of DBMS_SCHEDULER Subprograms
The following table lists the DBMS_SCHEDULER subprograms supported by the current version of OceanBase Database and provides brief descriptions.
subprogram |
Description |
|---|---|
| CREATE_JOB | Create a job. |
| CREATE_PROGRAM | Create a program. |
| DEFINE_PROGRAM_ARGUMENT | Defines a program parameter whose value can be passed to the program as a string literal. |
| DISABLE | Disable programs, jobs, and so on. |
| DROP_JOB | Delete a job or all jobs in a job class. |
| DROP_PROGRAM | Deletes a program. |
| ENABLE | Enable programs, jobs, and so on. |
| GENERATE_JOB_NAME | Generates a unique name for the job. |
| RUN_JOB | Execute the job immediately. |
| SET_ATTRIBUTE | Change the properties of a job, program, or other scheduler object. |
| SET_JOB_ARGUMENT_VALUE | Set the value of the job parameter. |
| ENABLE | Enable scheduled partition balancing. |
| STOP_JOB | Terminates a running job. |
