The DBMS_JOB package schedules and manages jobs in the job queue.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Note
The DBMS_JOB package is not recommended in OceanBase Database V4.x. We recommend that you use the DBMS_SCHEDULER package instead.
Privileges
You do not need any special system privileges to use and manage the DBMS_JOB package. Only the owner of a job or a user granted the database administrator (DBA) privileges can modify or delete the job.
Considerations
DBMS_JOB allows a job to run in multiple zones. By default, a job can run in any zone. However, only one zone can be specified for a job. You can specify the name of a zone to bind a job to the zone.
The following describes the procedure for creating, modifying, and running a job associated with a zone. If no associated zone is specified, the job can run in any zone.
Call
DBMS_JOB.SUBMITto submit the job to the job queue.Call
DBMS_JOB.ZONEto allocate a zone for running the job.Call
DBMS_JOB.CHANGEto modify the custom parameters related to the job.Call
DBMS_JOB.RUNto run the job.Stop the job.
Subprograms
The following table describes the DBMS_JOB subprograms supported by the current OceanBase Database version.
| Subprogram | Description |
|---|---|
| BROKEN | Prohibits job execution. |
| CHANGE | Modifies custom parameters related to 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 date of a specified job. |
| REMOVE | Removes a specified job from the job queue. |
| RUN | Forcibly runs a specified job. |
| SUBMIT | Submits a new job to the job queue. |
| USER_EXPORT | Generates the call text for re-creating a specified job. |
| WHAT | Modifies the execution content of a specified job. |