The RUN_JOB procedure runs a job immediately.
If the job is enabled, the Scheduler automatically runs the job according to its schedule. You do not need to call RUN_JOB to run the job. You call RUN_JOB only to run a job outside its normal schedule.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
DBMS_SCHEDULER.RUN_JOB (
job_name IN VARCHAR2,
force IN BOOLEAN );
Parameters
| Parameter | Description |
|---|---|
| job_name | The name or names of the job or jobs to run. You can specify a list of names separated by commas. Each name in the list must be the name of an existing job. You can optionally specify a schema name and a dot before the job name. If you specify multiple jobs, the Scheduler runs all of them. |
| force | Specifies whether to run the job regardless of its status. Set to TRUE to force the job to run. |
Considerations
Before you run a disabled job, the Scheduler performs the following validity checks:
The job is associated with a valid job class.
The job owner has the
EXECUTEprivilege on the job class.If the job references a program, the program must exist.
If the job references a program, the job owner has the
EXECUTEprivilege on the program.All parameter values are set (or have default values).
Examples
Run the MYJOB and SYS.HRJOB jobs immediately.
BEGIN
DBMS_SCHEDULER.RUN_JOB(
JOB_NAME => 'MYJOB, SYS.HRJOB',
force => TRUE);
END;
