The DISABLE procedure is used to disable programs and jobs.
When a Scheduler object is disabled, its enabled attribute is set to FALSE.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL mode.
Syntax
DBMS_SCHEDULER.DISABLE (
job_name IN VARCHAR2,
force IN BOOLEAN DEFAULT FALSE,
commit_semantics IN VARCHAR2 DEFAULT 'STOP_ON_FIRST_ERROR');
Parameters
Parameter |
Description |
|---|---|
| job_name | The name of the job to be disabled. You can specify multiple job names in a comma-separated list. If you specify a job class name, all jobs in that class will be disabled, but the job class itself will not be disabled. If you specify a group name, the group will be disabled, but the enable status of its members will not be affected. The following system-defined scheduled jobs are supported:
|
| force | If TRUE, the object will be disabled even if other objects depend on it. |
| commit_semantics | The commit semantics. Valid values:
|
Considerations
Disabling an already disabled object does not return an error.
The force option identifies dependencies without changing the dependent objects.
Disabling a job means that, although the job's metadata exists, it should not be processed or executed. When a job is disabled, its state in the job queue will change to disabled. If force is set to FALSE and the job is currently running, an error will be returned. If force is set to TRUE, the job will be disabled, but the currently running instance is allowed to complete.
When a program is disabled, its state becomes disabled. A disabled program means that, although the metadata still exists, any jobs pointing to it cannot be executed. If force is set to FALSE, no jobs can reference the program, otherwise an error will occur. If force is set to TRUE, jobs pointing to the program will not be disabled because their program becomes invalid, and they will fail. Running jobs pointing to the program are not affected by the DISABLE call and can continue to run. When a program is disabled, the parameters related to the program are not affected.
Examples
Disable the
empprogramjob.obclient(SYS@oracle001)[SYS]> delimiter //obclient(SYS@oracle001)[SYS]> BEGIN SYS.DBMS_SCHEDULER.DISABLE( job_name => 'empprogram', force => TRUE, COMMIT_SEMANTICS => 'STOP_ON_FIRST_ERROR'); END;//obclient(SYS@oracle001)[SYS]> delimiter ;Disable the scheduled partition balancing job.
obclient(SYS@oracle001)[SYS]> CALL DBMS_SCHEDULER.DISABLE(job_name => 'SCHEDULED_TRIGGER_PARTITION_BALANCE');or
obclient(SYS@oracle001)[SYS]> CALL DBMS_SCHEDULER.DISABLE('SCHEDULED_TRIGGER_PARTITION_BALANCE');
