Skip to content

DBA_SCHEDULER_JOBS - Monitor Oracle Scheduled Jobs

DBA_SCHEDULER_JOBS describes every job created through Oracle’s DBMS_SCHEDULER package, which replaced the legacy DBMS_JOB mechanism in Oracle 10g. Each row represents a scheduled unit of work — a PL/SQL block, stored procedure, external script, or executable — managed by the Oracle Scheduler infrastructure. Oracle uses DBMS_SCHEDULER internally for its own maintenance tasks (statistics gathering, segment advisor, space management), so this view covers both user-defined automation and Oracle-owned jobs.

DBAs rely on DBA_SCHEDULER_JOBS as the primary dashboard for job health: checking whether jobs are running on schedule, have failed recently, are currently executing, or have been accidentally disabled. It integrates with DBA_SCHEDULER_JOB_RUN_DETAILS for per-run history and DBA_SCHEDULER_PROGRAMS for reusable program definitions.

View Type: Static Data Dictionary View Available Since: Oracle 10g Required Privileges: SELECT on DBA_SCHEDULER_JOBS, SELECT_CATALOG_ROLE, or SELECT ANY DICTIONARY

ColumnDatatypeDescription
OWNERVARCHAR2(128)Schema that owns the job
JOB_NAMEVARCHAR2(128)Name of the job
JOB_SUBNAMEVARCHAR2(128)Subname for a job step within a chain; NULL for top-level jobs
JOB_STYLEVARCHAR2(17)REGULAR, LIGHTWEIGHT, or IN_MEMORY_RUNTIME
JOB_TYPEVARCHAR2(16)PLSQL_BLOCK, STORED_PROCEDURE, EXECUTABLE, EXTERNAL_SCRIPT, or SQL_SCRIPT
JOB_ACTIONVARCHAR2(4000)PL/SQL text, procedure name, or executable path that the job runs
SCHEDULE_TYPEVARCHAR2(12)ONCE, NAMED, CALENDAR, IMMEDIATE, or EVENT
START_DATETIMESTAMP WITH TIME ZONEEarliest date and time the job will run
REPEAT_INTERVALVARCHAR2(4000)DBMS_SCHEDULER calendar expression or PL/SQL expression defining recurrence
END_DATETIMESTAMP WITH TIME ZONEDate after which the job will not run; NULL for no end date
ENABLEDVARCHAR2(5)TRUE if the job is enabled; FALSE if disabled
STATEVARCHAR2(15)DISABLED, RETRY SCHEDULED, SCHEDULED, RUNNING, COMPLETED, BROKEN, FAILED, REMOTE, SUCCEEDED, or CHAIN_STALLED
LAST_START_DATETIMESTAMP WITH TIME ZONEDate and time of the most recent execution start
LAST_RUN_DURATIONINTERVAL DAY TO SECONDWall-clock duration of the most recent execution
NEXT_RUN_DATETIMESTAMP WITH TIME ZONEScheduled date and time for the next execution
RUN_COUNTNUMBERTotal number of times the job has been run since it was created
FAILURE_COUNTNUMBERNumber of failed runs since the job was created
RETRY_COUNTNUMBERNumber of retry attempts for the current or most recent run
MAX_FAILURESNUMBERMaximum allowed consecutive failures before the job is marked BROKEN; NULL for unlimited
MAX_RUNSNUMBERMaximum total runs before the job is automatically disabled; NULL for unlimited
COMMENTSVARCHAR2(240)Optional description of the job
LOGGING_LEVELVARCHAR2(11)OFF, RUNS, FAILED RUNS, or FULL — controls detail level in DBA_SCHEDULER_JOB_LOG
AUTO_DROPVARCHAR2(5)TRUE if the job is automatically dropped after it completes or expires

List all user-defined enabled jobs with schedule and recent execution status:

SELECT
owner,
job_name,
job_type,
enabled,
state,
last_start_date,
last_run_duration,
next_run_date,
run_count,
failure_count,
SUBSTR(job_action, 1, 80) AS job_action
FROM
dba_scheduler_jobs
WHERE
owner NOT IN ('SYS', 'SYSTEM', 'DBSNMP', 'ORACLE_OCM', 'XDB')
ORDER BY
owner,
job_name;

Find all failed or broken jobs, along with jobs whose failure count has increased — the first-line check in a scheduler health review:

SELECT
owner,
job_name,
enabled,
state,
last_start_date,
last_run_duration,
run_count,
failure_count,
retry_count,
next_run_date,
SUBSTR(job_action, 1, 100) AS job_action
FROM
dba_scheduler_jobs
WHERE
state IN ('FAILED', 'BROKEN', 'CHAIN_STALLED')
OR failure_count > 0
ORDER BY
failure_count DESC,
state;

Join DBA_SCHEDULER_JOBS with DBA_SCHEDULER_JOB_RUN_DETAILS to show the last 5 run outcomes per job, including error codes:

SELECT
j.owner,
j.job_name,
j.state,
r.log_date,
r.status,
r.run_duration,
r.error#,
r.additional_info
FROM
dba_scheduler_jobs j
JOIN dba_scheduler_job_run_details r ON r.owner = j.owner
AND r.job_name = j.job_name
WHERE
j.owner NOT IN ('SYS', 'SYSTEM', 'DBSNMP')
AND r.log_date >= SYSTIMESTAMP - INTERVAL '7' DAY
ORDER BY
j.owner,
j.job_name,
r.log_date DESC;

Show all jobs in the RUNNING state with their duration so far, useful for detecting hung or runaway jobs:

SELECT
j.owner,
j.job_name,
j.state,
j.last_start_date,
ROUND(
EXTRACT(HOUR FROM (SYSTIMESTAMP - j.last_start_date)) * 60
+ EXTRACT(MINUTE FROM (SYSTIMESTAMP - j.last_start_date))
+ EXTRACT(SECOND FROM (SYSTIMESTAMP - j.last_start_date)) / 60,
1
) AS mins_running,
j.last_run_duration,
j.job_type,
SUBSTR(j.job_action, 1, 100) AS job_action
FROM
dba_scheduler_jobs j
WHERE
j.state = 'RUNNING'
ORDER BY
mins_running DESC;

Identify jobs that are enabled but overdue — NEXT_RUN_DATE is in the past and the job is not currently running:

SELECT
owner,
job_name,
enabled,
state,
next_run_date,
ROUND(
(CAST(SYSTIMESTAMP AS DATE) - CAST(next_run_date AS DATE)) * 1440,
1
) AS mins_overdue,
last_start_date,
failure_count,
repeat_interval
FROM
dba_scheduler_jobs
WHERE
enabled = 'TRUE'
AND state != 'RUNNING'
AND next_run_date < SYSTIMESTAMP
AND owner NOT IN ('SYS', 'SYSTEM', 'DBSNMP')
ORDER BY
mins_overdue DESC;
  • Nightly batch monitoring — Check STATE and LAST_RUN_DURATION each morning to confirm that batch jobs completed successfully within their expected time windows
  • Failure count alerting — Set up monitoring scripts that alert when FAILURE_COUNT increases between checks, catching problems before they reach MAX_FAILURES and cause the job to break
  • Disabled job audit — Filter ENABLED = ‘FALSE’ to find jobs that may have been accidentally disabled during maintenance and not re-enabled
  • Running time trend analysis — Compare LAST_RUN_DURATION over time using DBA_SCHEDULER_JOB_RUN_DETAILS to detect jobs that are gradually slowing down, indicating growing data volumes or degrading plans
  • Oracle internal job review — Query jobs where OWNER IN (‘SYS’, ‘SYSTEM’) to see Oracle’s own maintenance jobs (statistics gathering, segment advisor, AWR snapshots) and confirm they are running on schedule
  • Scheduler infrastructure verification — After a database restart, confirm that all expected jobs have transitioned from DISABLED or SCHEDULED to RUNNING at their correct NEXT_RUN_DATE
  • DBA_JOBS — Legacy DBMS_JOB view; many production databases still have jobs in both views during migration
  • V$SESSION — Find the Oracle session associated with a currently running scheduler job; join via MODULE or ACTION set by the scheduler
  • DBA_SCHEDULER_JOB_RUN_DETAILS — Per-run history with status, duration, error codes, and log output; the most detailed source for failure diagnosis
  • DBA_SCHEDULER_JOB_LOG — Summary log of job executions; less detail than JOB_RUN_DETAILS but faster to query for high-frequency jobs
  • DBA_SCHEDULER_PROGRAMS — Reusable program definitions referenced by jobs; shows the full JOB_ACTION and argument list for program-based jobs
  • DBA_SCHEDULER_CHAINS — Job chain definitions; relevant when STATE = ‘CHAIN_STALLED’
  • Oracle 10g: DBA_SCHEDULER_JOBS introduced alongside DBMS_SCHEDULER; basic PL/SQL and stored procedure job types supported
  • Oracle 11g: External script jobs (EXECUTABLE, EXTERNAL_SCRIPT types) added; credential-based execution for OS commands; event-based scheduling via SCHEDULE_TYPE = ‘EVENT’
  • Oracle 12c: Lightweight jobs (JOB_STYLE = ‘LIGHTWEIGHT’) and in-memory runtime jobs introduced for very high-frequency scheduling; CON_ID column for CDB/PDB distinction
  • Oracle 19c: Automatic in-memory scheduler improvements; Oracle-owned maintenance jobs (AUTO TASK) increasingly use DBMS_SCHEDULER internally; no structural changes to the view
  • Oracle 23ai: No structural changes; SQL Firewall and other 23ai security features generate their own scheduler jobs visible in DBA_SCHEDULER_JOBS under the SYS schema