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 does not support this feature.
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 as a comma-separated list. If a job class name is specified, all jobs within that class will be disabled, but the job 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. System-defined scheduled tasks are as follows:
|
| force | If TRUE, the object will be disabled even if other objects depend on it. |
| commit_semantics | The commit semantics. Supported types:
|
Considerations
Disabling an already disabled object does not generate an error.
The force option is used to identify dependencies and does not change the dependent objects.
Disabling a job means that the job's metadata exists, but 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 the metadata still exists, but any jobs pointing to it cannot run. If force is set to FALSE, no job 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 they become invalid and 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 task.
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');Disable the window compaction task.
obclient(SYS@oracle001)[SYS]> CALL DBMS_SCHEDULER.DISABLE(job_name => 'DAILY_MAINTENANCE_WINDOW');Or
obclient(SYS@oracle001)[SYS]> CALL DBMS_SCHEDULER.DISABLE('DAILY_MAINTENANCE_WINDOW');
