EDB Job Scheduler

Suggest edits

EDB Job Scheduler is an extension that runs the job scheduler as a background process for the DBMS_SCHEDULER and DBMS_JOB packages.

By default, the edb_job_scheduler extension resides in the contrib/dbms_scheduler_ext subdirectory under the EDB Postgres Advanced Server installation.

The extension has a main background process called the launcher. The launcher process starts when the database cluster loads. It forks the scheduler processes, creating one for each configured database. The databases are configured by the GUC edb_job_scheduler.database_list.

If a database doesn't have any jobs to schedule or is done with all the schedules, after waiting for a minute, the scheduler process shuts down. Whenever a new job is added or there is any update to the existing jobs in sys.jobs, the launcher process starts again.

EDB Job Schedule schedules the job only once based on the job runtime. If the same job needs to be rerun, then you need to feed the next job runtime.

All the recurring job scheduling is done through the DBMS_SCHEDULER and DBMS_JOB packages. For a recurring job, the next job runtime is added by these packages and not by edb_job_scheduler.

edb_job_scheduler holds its meta data in two tables under the sys schema:

  • jobs Holds information about the jobs to run.
  • job_run_details Holds information about the job status. The status can be 'r' - running, 's' - success, or 'f' - failure for the respective jobid.

The following are the columns in the sys.job table:

   Column   |           Type
 jobid      | bigint
 jobnextrun | timestamp with time zone
 jobcommand | text
 jobuser    | text

The following are the columns in the sys.job_run_details table:

    Column    |           Type
 jobid        | bigint
 runid        | bigint
 username     | text
 workerpid    | integer
 status       | character(1)
 error        | text
 scheduletime | timestamp with time zone
 starttime    | timestamp with time zone
 endtime      | timestamp with time zone

Could this page be better? Report a problem or suggest an addition!