Skip to main content

Scheduler jobs running now

When to use it

During the daily check, and when someone asks if a batch job is still running.

Run this

Script: 02_show_running_jobs.sql. Full version in Administration › Scheduler management › Scheduler status.

SET LINESIZE 150
SET PAGESIZE 50

COLUMN OWNER FORMAT A15
COLUMN JOB_NAME FORMAT A30
COLUMN JOB_SUBNAME FORMAT A30
COLUMN SESSION_ID FORMAT 999999
COLUMN SLAVE_PROCESS_ID FORMAT 999999
COLUMN SLAVE_OS_PROCESS_ID FORMAT A12
COLUMN RUNNING_INSTANCE FORMAT 999999
COLUMN RESOURCE_CONSUMER_GROUP FORMAT A32
COLUMN ELAPSED_TIME FORMAT A20
COLUMN CPU_USED FORMAT A20

SELECT 
    OWNER,
       JOB_NAME,
    JOB_SUBNAME,
    SESSION_ID,
    SLAVE_PROCESS_ID,
    SLAVE_OS_PROCESS_ID,
    RUNNING_INSTANCE,
    RESOURCE_CONSUMER_GROUP,
    ELAPSED_TIME,
    CPU_USED
FROM 
    DBA_SCHEDULER_RUNNING_JOBS
ORDER BY 
    ELAPSED_TIME DESC;

How to read the output

  • No rows means no scheduler job is running at this moment. That is normal outside batch windows.
  • elapsed_time is how long the job has been running. Compare it with the usual duration of that job.
  • session_id and running_instance let you find the session behind the job.

What to do next

  • For a job that is running much longer than usual, look at its session in chapter 4 before you think about stopping it.
  • To see whether jobs failed overnight, go to "Job run history" in chapter 8.

Risk level

READ ONLY Safe to run at any time. It only queries the data dictionary.