The DISABLE procedure disables 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-compatible 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. Multiple job names can be specified in a comma-separated list. If a job class name is specified, all jobs in that class will be disabled, but the class itself will not be disabled. If a group name is specified, the group will be disabled, but the enable status of its members will remain unchanged. |
| 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 result in an error.
The force option identifies dependencies without altering 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 changes to disabled. If force is set to FALSE and the job is currently running, an error is 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 status becomes disabled. A disabled program means that, although the metadata still exists, any jobs pointing to it cannot run. 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 running. When a program is disabled, the parameters related to the program are not affected.
Examples
-- View all jobs (requires DBA privileges)
SELECT JOB, LOG_USER, WHAT, NEXT_DATE, INTERVAL, BROKEN, FAILURES
FROM DBA_JOBS;
BEGIN
SYS.DBMS_SCHEDULER.DISABLE(
job_name => 'empprogram',
force => TRUE,
COMMIT_SEMANTICS => 'STOP_ON_FIRST_ERROR');
END;