How to create a scheduled singleton job in oracle?

These are probably just words that I'm missing to find out how to do this:

The scheduled task should be run every 5 minutes, however, to ensure that it does not start two instances at the same time, i.e. the next instance will be delayed or skipped if the previous runs are longer than 5 minutes.

What is the easiest / most elegant way to achieve this?

+4
source share
4 answers

DBMS_JOB will take care of this. Just use it.

+3
source

In the Oracle 10g Admin Guide:

"The DBMS_JOB package has been replaced by the DBMS_SCHEDULER package . In particular, if you are managing jobs to control system loading, you should consider disabling DBMS_JOB by revoking the package privilege for users."

DBMS_SCHEDULER is Oracle's recommended way to do this now. One of the benefits is that you can manage your tasks through Enterprise Manager / Grid Control if you use this.

+4
source

The other advantage that dbms_scheduler has above dbms_job is that you can better control loading, resource usage and completing tasks external to the database.

NTN, Ronald.

+1
source

If for some reason dbms_job or dbms_scheduler does not work for you, you can also use DBMS_APPLICATION_INFO.SET_APPLICATION_INFO to set the name of the module for your job, and you can query the v $ session to find out how many sessions are currently running by this module.

What kind of work is this? PL / SQL stored procedure?

-1
source

Source: https://habr.com/ru/post/1286746/


All Articles