v$open_cursor shows cached cursors, not currently open cursors, by session. If you're wondering how many cursors a session has open, don't look in v$open_cursor. It shows the cursors in the session cursor cache for each session, not cursors that are actually open.
To monitor open cursors, query v$sesstat where name='opened cursors current'. This will give the number of currently opened cursors, by session:
--total cursors open, by session
select a.value, s.username, s.sid, s.serial#
from v$sesstat a, v$statname b, v$session s
where a.statistic# = b.statistic# and s.sid=a.sid
and b.name = 'opened cursors current';
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-631446/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/35489/viewspace-631446/
本文介绍如何使用Oracle数据库的视图v$sesstat来监控当前打开的游标数量,以了解每个会话中活跃的SQL查询状态。通过查询v$sesstat视图中名为'openedcursorscurrent'的统计信息可以获取指定会话打开的游标总数。
164

被折叠的 条评论
为什么被折叠?



