>데이터 베이스 >MySQL 튜토리얼 >通过视图查历史等待事件

通过视图查历史等待事件

WBOY
WBOY원래의
2016-06-07 15:22:221529검색

过去发生的等待事件,我们可以通过什么视图查出来呢? 1.自实例启动以来 select * from ( select event,total_waits,time_waited,wait_class from v$system_event where wait_classIdle order by 3 desc )where rownum=50; 9i select * from ( select event,

过去发生的等待事件,我们可以通过什么视图查出来呢?

1.自实例启动以来

select * from ( select event,total_waits,time_waited,wait_class from v$system_event where wait_class'Idle' order by 3 desc )where rownum

2.当前已连接的各会话的历史等待事件信息

select * from (select event, wait_class, sum(total_waits), sum(time_waited) from v$session_event where wait_class 'Idle' group by event, wait_class order by sum(time_waited) desc) where rownum 9i select * from (select event, sum(total_waits), sum(time_waited) from v$session_event where event not in ('rdbms ipc message','pmon timer','smon timer','SQL*Net message from client','rdbms ipc reply','SQL*Net more data from client') group by event order by sum(time_waited) desc) where rownum

3.当前已连接的某SESSION的历史等待事件信息

select * from (select sid, event, total_waits, time_waited from v$session_event where sid=&1 order by sid asc,time_waited desc) where event not like '%rdbms ipc%' and event not like '%SQL*Net message%';
9i: select sid, event, total_waits, time_waited from v$session_event where sid in (&1) order by sid asc,time_waited desc

备注: total_waits代表总共等待的次数,比较重要的是time_waited的,这反映了用户的等待体验,time_waited是百分之一秒。

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.