The RUN_JOB procedure immediately runs a job.
If a job is enabled, the Scheduler automatically runs the job. You do not need to call the RUN_JOB procedure to run the job based on its schedule. You call the RUN_JOB procedure to run only jobs that are not scheduled.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
DBMS_SCHEDULER.RUN_JOB (
job_name IN VARCHAR2,
force IN BOOLEAN );
Parameters
| Parameter | Description |
|---|---|
| job_name | The name of a job or a list of names that are separated by commas (,). Each name represents an existing job. You can add a schema name and dot separator before the name. If you specify a job that involves multiple destinations, the job runs on all destinations. |
| force | Specify whether to force run the job. The value TRUE specifies to force run the job. |
Considerations
If a job is disabled, make sure that the following validity requirements are met before you run the job:
The job points to a valid job class.
The job owner has the
EXECUTEprivilege on the job.If a program is referenced, the program must exist.
If a program is referenced, the job owner must have the privilege to execute the program.
All parameter values are set or have default values.
Examples
Immediately run the MYJOB and SYS.HRJOB jobs.
BEGIN
DBMS_SCHEDULER.RUN_JOB(
JOB_NAME => 'MYJOB, SYS.HRJOB',
force => TURE);
END;