Hello everyone,
I have a DBMS_SCHEDULER's job scheduled to be executed every X seconds (parametrized). One run of the job may take from couple seconds if no data is available to couple minutes.
During a "maintenance" window, I would need to:
1. if the job is running then wait for it to finish gracefully (it may be running a long-running SQL).
I need the job to finish properly.
2. then disable/drop it (prevent it from being executed)
3. now I do my maintenance stuff, DB export, whatever
4. after I'm done, I would like the job to be rescheduled again.
After going through documentation, I'm not entirely sure what DBMS_SCHEDULER.STOP_JOB does, quoting:
+If force is set to FALSE, the Scheduler
tries to gracefully stop the job using an interrupt mechanism. This method gives control back to the slave process, which can update the status of the job in the job queue to stopped. If this fails, an error is returned.+
What does that mean in human language?
If I do something like this:
DBMS_SCHEDULER.STOP_JOB('MyJob', false);
DBMS_SCHEDULER.DROP_JOB('MyJob');
Is it going to let the job end gracefully or not?
Thank you,
Regards,
Adam