[Translated from mos] DBA_JOBS and DBA_JOBS_RUNNING explain different results, dbajobsrunning
Different results of DBA_JOBS and DBA_JOBS_RUNNING
Reference Original:
Different Results from DBA_JOBS and DBA_JOBS_RUNNING (Doc ID 109725.1)
Purpose:
Explain the relationship between DBA_JOBS and DBA_JOBS_RUNNING.
Range:
Dba
You can find that one record can be queried in DBA_JOBS_RUNNING, but no record can be found in DBA_JOBS.
You are worried that the data dictionary (dd) is damaged.
Explanation:
Dba_jobs definition:
Select JOB, lowner LOG_USER, powner PRIV_USER, cowner SCHEMA_USER,
LAST_DATE, substr (to_char (last_date, 'hh24: MI: ss'), 1, 8) LAST_SEC,
THIS_DATE, substr (to_char (this_date, 'hh24: MI: ss'), 1, 8) THIS_SEC,
NEXT_DATE, substr (to_char (next_date, 'hh24: MI: ss'), 1, 8) NEXT_SEC,
(Total + (sysdate-nvl (this_date, sysdate) * 86400 TOTAL_TIME,
Decode (mod (FLAG, 2), 1, 'y', 0, 'n ','? ') BROKEN,
INTERVAL # interval, FAILURES, WHAT,
Nlsenv NLS_ENV, env MISC_ENV, j. field1 INSTANCE
From sys. job $ j
DBA_JOBS_RUNNING definition:
Select v. SID, v. id2 JOB, j. FAILURES,
LAST_DATE, substr (to_char (last_date, 'hh24: MI: ss'), 1, 8) LAST_SEC,
THIS_DATE, substr (to_char (this_date, 'hh24: MI: ss'), 1, 8) THIS_SEC,
J. field1 INSTANCE
From sys. job $ j, v $ lock v
Where v. type = 'jq' and j. job (+) = v. id2
There is an interesting external connection in the where condition of DBA_JOBS_RUNNING. This external connection means
DBA_JOBS_RUNNING: displays those that are not in sys. job $, but can be seen in v $ lock (the job is running)
For example, this may be because the job has just been removed and has not been completed yet.
Table or view does not exists is reported when dba_jobs_running is used.
This is a permission issue, because you are using a synonym in PUBLIC, you can use grant select on sys. dba_jobs_running to the user.
In oracle, I declare a job. Why not execute it? I queried the dba_jobs table, which contains the job I just declared.
Job execution failed. After 16 retries, it stops.
Check the job content and execute it manually to see where the error is.