The DISABLE procedure disables a program or job.
When a Scheduler object is disabled, the enabled attribute of the object is set to FALSE.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the 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 disable. You can specify a list of names separated with commas (,). If you specify a job class name, all jobs in the class are disabled, but the job class itself is not disabled. If you specify a group name, the group is disabled, but the status of the members in the group is not affected. |
| force | If you set this parameter to TRUE, the object is disabled even if other objects depend on it. |
| commit_semantics | The commit semantics. The following types are supported:
|
Considerations
If you disable an object that has been disabled, no error is returned.
The force parameter is provided only to identify dependencies and does not change the dependent objects.
After you disable a job, the job does not run or is not processed even if the metadata of the job exists. When a job is disabled, its status in the job queue changes to disabled. If you set the force parameter of a running job to FALSE, an error is returned. If you set the force parameter to TRUE, the job is disabled, but the currently running instance is allowed to complete.
When a program is disabled, its status changes to disabled. After you disable a program, the jobs pointing to the program cannot run even if the metadata of the program exists. If you set force to FALSE, the program must be referenced by no job while being dropped. Otherwise, an error occurs. If you set the force parameter to TRUE, the jobs pointing to the program are not disabled. However, these jobs fail at runtime because the program becomes invalid. The running jobs pointing to this program are not affected by the DISABLE operation and can continue running. If a program is disabled, parameters related to the program are not affected.
Examples
BEGIN
SYS.DBMS_SCHEDULER.DISABLE(
job_name => 'empprogram',
force => TRUE,
COMMIT_SEMANTICS => 'STOP_ON_FIRST_ERROR');
END;