The DBMS_JOB package is used to schedule and manage jobs in the job queue.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Note
It is not recommended to use the DBMS_JOB package in OceanBase Database V4.x. Instead, use the DBMS_SCHEDULER package.
Privilege requirements for DBMS_JOB
You do not need any specific system privileges to use and manage DBMS_JOB. Only the job owner or a user granted the DBA privilege can modify or delete a job.
Considerations for using DBMS_JOB
DBMS_JOB supports multi-zone execution of jobs. By default, a job can be executed in any zone, but only one zone can be selected. You can bind a job to a specific zone by specifying the zone name.
The following describes the execution process for creating, modifying, or running a job associated with a zone. If no zone is specified, the job can be executed in any zone.
Call the
DBMS_JOB.SUBMITprocedure to submit the job to the job queue.Call the
DBMS_JOB.ZONEprocedure to assign the specified zone for the job.Call the
DBMS_JOB.CHANGEprocedure to modify the user-defined parameters associated with the job.Call the
DBMS_JOB.RUNprocedure to run the job.Stop the job.
Overview of DBMS_JOB subprograms
The following table describes the subprograms supported by OceanBase Database in the current version and their descriptions.
| Subprogram | Description |
|---|---|
| BROKEN | Prevents the execution of a job. |
| CHANGE | Modifies the user-defined parameters associated with a job. |
| ZONE | Modifies the association between a job and a zone. |
| INTERVAL | Modifies the execution interval of a specified job. |
| NEXT_DATE | Modifies the next execution time of a specified job. |
| REMOVE | Removes a specified job from the job queue. |
| RUN | Forces the execution of a specified job. |
| SUBMIT | Submits a new job to the job queue. |
| USER_EXPORT | Generates the call text for recreating a specified job. |
| WHAT | Modifies the execution content of a specified job. |
