RAC version of dba_jobs_running

Home

Toolkit:

My OraFAQ Blog

Contact me

The DBA view dba_jobs_running isn't as useful on a RAC because it uses v$lock instead of gv$lock, so it only shows the jobs running on the instance you're logged in to. Here is a RAC version of dba_jobs_running.

/* RAC dba_jobs_running */
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,
    v.INST_ID instance
  from sys.job$ j, gv$lock v
  where v.type = 'JQ' and j.job (+)= v.id2
;


Note: Proofread any scripts before using. Always try scripts on a test instance first. I'm not responsible for any damage, even if you somehow manage to make my scripts corrupt every last byte of your data, set your server on fire and serve you personally with an eviction notice from your landlord!
All scripts and tips © Natalka Roshak 2001-2005.
Enjoy the FREE tips folks...