Oracle7 Server Administrator's Guide

Contents Index Home Previous Next

Viewing Job Queue Information

You can view information about jobs in the job queue via the data dictionary views in Table 7 - 6:

View Description
DBA_JOBS Lists all the jobs in the database.
USER_JOBS Lists all jobs owned by the user.
DBA_JOBS_RUNNING Lists all jobs in the database that are currently running. This view joins V$LOCK and JOB$.
Table 7 - 6. Views for Viewing Job Queue Information

For example, you can display information about a job's status and failed executions. The following sample query creates a listing of the job number, next execution time, failures, and broken status for each job you have submitted:

SVRMGR> SELECT job, next_date, next_sec, failures, broken
     2> 	FROM user_jobs;
JOB        NEXT_DATE NEXT_SEC FAILURES   B
---------- --------- -------- ---------- -
      9125 01-NOV-94 00:00:00          4 N
     14144 24-OCT-94 16:35:35          0 N
     41762 01-JAN-00 00:00:00         16 Y
3 rows selected.

You can also display information about jobs currently running. The following sample query lists the session identifier, job number, user who submitted the job, and the start times for all currently running jobs:

SVRMGR> SELECT sid, r.job, log_user, r.this_date, r.this_sec
     2> 	FROM dba_jobs_running r, dba_jobs j
     3> 	WHERE r.job = j.job;
SID        JOB        LOG_USER             THIS_DATE THIS_SEC
---------- ---------- -------------------- --------- --------
        12      14144 JFEE                 24-OCT-94 17:21:24
        25       8536 SCOTT                24-OCT-94 16:45:12
2 rows selected.

See Also: For more information on data dictionary views, see the Oracle7 Server Reference.


Contents Index Home Previous Next