The ENABLE procedure enables a program or job.
When an object is enabled, the enabled parameter of the object is set to TRUE. By default, a newly created program or job is 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 object being enabled by the Scheduler. You can specify a list of names and separate them with commas (,). If you specify a job class name, all jobs in the class are enabled. The following internal scheduled jobs are defined in the system:
|
Considerations
You can use
ENABLEon any schemas except for theSYSschema.To enable the
SCHEDULED_TRIGGER_PARTITION_BALANCEjob, the tenant-level parameterpartition_balance_schedule_intervalmust be set to0. Otherwise, an errorOB_OP_NOT_ALLOWis returned. The trigger and scheduled job cannot be enabled at the same time.
Examples
Enable the procedure 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 balance job.
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');
