--accessible cursors
SELECT oc.user_name, st.sql_text
FROM
v$open_cursor oc, v$sqltext st
WHERE
oc.address = st.address AND
oc.hash_value = st.hash_value
ORDER BY oc.user_name, st.piece
For performance reasons, pl/sql cursors are cached for future reuse . so once you use them up they will be added to LRU list of cursor table. Hence you can see them in v$open_cursor.
--actual open cursors
select sum(a.value), b.name
from v$sesstat a, v$statname b
where a.statistic# = b.statistic#
and b.name = 'opened cursors current'
group by b.name
|