Wednesday, July 8, 2009

Query to Count open cursor in Oracle

select sum(a.value) total_cur, avg(a.value) avg_cur, max(a.value) max_cur,
s.username, s.machine, s.SID
from v$sesstat a, v$statname b, v$session s
where a.statistic# = b.statistic# and s.sid=a.sid --AND s.username = 'KMC'
and b.name = 'opened cursors current'
group by s.username, s.machine, s.SID
order by 4 DESC

No comments:

Post a Comment

Troubleshooting ACFS-07981: Metadata Validation Errors

  Troubleshooting ACFS-07981: Metadata Validation Errors Introduction The ACFS-07981 error indicates that an attempt to run an online file ...