看latch free等待的是哪些latch.sql
select addr,latch#,name,gets,spin_gets from v$latch
order by spin_gets desc
通过HASH值找出会话的SQL语句.sql
select * from v$sqlarea a where a.HASH_VALUE=2000517657
--获取打开的游标数
select o.sid, osuser, machine, count(*) num_curs from v$open_cursor o, v$session s
where user_name = 'WLOA' and o.sid=s.sid group by o.sid, osuser, machine order by num_curs Desc
select *
from v$open_cursor Where user_name='WLOA'
----获取为游标执行的 SQL
select q.sql_text
from v$open_cursor o, v$sql q
where q.hash_value=o.hash_value and o.sid = 51
----会话查询
select username,sid,serial# from v$session a Where a.username='WLOA'
----查询系统进程等待事件.sql
select * from v$session_wait
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/54212/viewspace-976936/ ,如需转载,请注明出处,否则将追究法律责任。