DBAtlas · Database operations atlas

List scheduled jobs / view their status

Oracle

SELECT job_name, enabled, state, last_start_date, next_run_date
FROM dba_scheduler_jobs
ORDER BY next_run_date;
-- Run history: SELECT job_name, status, actual_start_date, run_duration
--                 FROM dba_scheduler_job_run_details ORDER BY log_date DESC;

dba_scheduler_jobs shows the defined jobs and their states; dba_scheduler_job_run_details shows the success/failure results of past runs.

PostgreSQL

SELECT jobid, schedule, command, nodename, active FROM cron.job;
-- Run history:
SELECT jobid, status, return_message, start_time, end_time
FROM cron.job_run_details ORDER BY start_time DESC LIMIT 20;

With pg_cron, cron.job lists the defined jobs and cron.job_run_details gives the status and return message of each run.

MySQL

SELECT event_schema, event_name, status, interval_value, interval_field, last_executed
FROM information_schema.events
ORDER BY last_executed DESC;

information_schema.events lists the defined events, their status (ENABLED/DISABLED) and last execution time.

SQL Server

SELECT j.name, j.enabled, h.run_status, h.run_date, h.run_time
FROM msdb.dbo.sysjobs j
LEFT JOIN msdb.dbo.sysjobhistory h ON h.job_id = j.job_id AND h.step_id = 0
ORDER BY h.run_date DESC, h.run_time DESC;

msdb.dbo.sysjobs gives the defined Agent jobs, and sysjobhistory gives the run history and outcome (run_status).

MongoDB

# Not applicable: there is no built-in scheduler, so there are no jobs to list. If Atlas Triggers are used, view them in the Atlas UI/API.

Community MongoDB has no job table; Atlas Triggers are managed in the Atlas interface.

Redis

# Not applicable: Redis has no concept of scheduled jobs, so there are no jobs to list.

Redis includes no job scheduler; there are no jobs to list.

Elasticsearch

GET _slm/policy
GET _ilm/policy
// For Watcher states: GET _watcher/stats  and  GET _watcher/_query/watches

_slm/policy lists snapshot policies, _ilm/policy lists lifecycle policies, and _watcher/stats shows Watcher execution state.

Open in DBAtlas →