The ENABLE procedure enables programs and jobs.
When an object is enabled, its enabled attribute is set to TRUE. By default, newly created jobs and programs are disabled.
If a job is disabled and then enabled, the Scheduler automatically runs the job based on its schedule.
A validity check is performed before the object is enabled. If the object fails the check, the object cannot be enabled, and the corresponding error message is returned. If the object is already enabled, no error is returned.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL-compatible mode.
Syntax
DBMS_SCHEDULER.ENABLE (
job_name IN VARCHAR2);
Parameters
Parameter |
Description |
|---|---|
| job_name | The name of the Scheduler object being enabled. You can specify a comma-separated list of names. If you specify a job class name, all jobs in that class are enabled. The system-defined scheduled tasks are as follows:
|
Considerations
You can use
ENABLEon any schema except theSYSschema.When you enable the scheduled partition balancing task
SCHEDULED_TRIGGER_PARTITION_BALANCE, the tenant-level configuration itempartition_balance_schedule_intervalmust be set to0. Otherwise, the errorOB_OP_NOT_ALLOWis returned. The configuration item trigger and the scheduled task trigger cannot both be enabled at the same time.
Examples
Enable the program named
job_test.obclient(SYS@oracle001)[SYS]> delimiter //obclient(SYS@oracle001)[SYS]> BEGIN DBMS_SCHEDULER.ENABLE(job_name => 'job_test'); END;//obclient(SYS@oracle001)[SYS]> delimiter ;Enable the scheduled partition balancing task.
obclient(SYS@oracle001)[SYS]> CALL DBMS_SCHEDULER.ENABLE(job_name => 'SCHEDULED_TRIGGER_PARTITION_BALANCE');or
obclient(SYS@oracle001)[SYS]> CALL DBMS_SCHEDULER.ENABLE('SCHEDULED_TRIGGER_PARTITION_BALANCE');
