Thursday, July 9, 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

Command to do active duplicate for Oracle Database

1. First login to target server 2. Validate tns connectivity between Source DB and Target DB 3. Prepare and validate space availability 4. S...