- 最后登录
- 2022-10-11
- 在线时间
- 137 小时
- 威望
- 163
- 金钱
- 1477
- 注册时间
- 2012-1-10
- 阅读权限
- 50
- 帖子
- 217
- 精华
- 1
- 积分
- 163
- UID
- 158
|
4#
发表于 2012-6-27 09:46:03
我这个好象是来自metalink来查询current open cursor的脚本
show parameter session_cached_cursor
drop view user_cursors;
create view user_cursors as
select
ss.username||'('||se.sid||') ' user_process, sum(decode(name,'recursive calls',value)) "Recursive Calls",
sum(decode(name,'opened cursors cumulative',value)) "Opened Cursors", sum(decode(name,'opened cursors current',value)) "Current Cursors"
from v$session ss, v$sesstat se, v$statname sn
where se.statistic# = sn.statistic#
and ( name like '%opened cursors current%'
OR name like '%recursive calls%'
OR name like '%opened cursors cumulative%')
and se.sid = ss.sid
and ss.username is not null
group by ss.username||'('||se.sid||') ';
ttitle 'Per Session Current Cursor Usage '
column USER_PROCESS format a25;
column "Recursive Calls" format 999,999,999;
column "Opened Cursors" format 99,999;
column "Current Cursors" format 99,999;
select * from user_cursors
order by "Recursive Calls" desc; |
|