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.
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. In this case, you must set the use_current_session parameter to FALSE. |
| use_current_session | Specifies whether the job can run in the same session that calls the procedure. By default, the job is always run by its owner in the schema of the owner. If credentials are specified, the job is run by the user specified in the credentials. Note the following information if the use_current_session parameter is set to TRUE:
use_current_session parameter is set to FALSE:
|
Usage notes
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
The following sample statement immediately runs the MYJOB and SYS.HRJOB jobs:
BEGIN
DBMS_SCHEDULER.RUN_JOB(
JOB_NAME => 'MYJOB, SYS.HRJOB',
force => TURE);
END;