1、v$system_event
内容:统计数据,统计instance启动以来每种等待时间的等待次数、时间、平均时间等
目的:用来发现系统级评瓶颈
SQL> desc v$system_event
Name
------------------------
EVENT
TOTAL_WAITS --总等待次数
TOTAL_TIMEOUTS --等待超时次数
TIME_WAITED --总的等待时间,单位是百分之一秒 (最重要考虑)
AVERAGE_WAIT -- 平均等待时间,总的等待时间/总等待次数
TIME_WAITED_MICRO --总的等待时间的微秒形式 1/1000000
常见的等待现象:
latch free
enqueue
free buffer waits
buffer busy waits: 查看V$WAITSTAT
db file sequential read
db file scattered read
2、v$session_event(仅比v$system_event多一个sid字段)
内容:每个session所有等待事件的统计信息
目的:用来诊断缓慢原因
3、v$session或v$session_wait(当前session含 active和inactive)正在等待什么,无等待则显示上一次等待信息
SID: session id
? EVENT: Event the session is currently waiting for, or the last event the session had to wait for
? WAIT_TIME: Time (in hundredths of a second) that the session waited for the event; if the WAIT_TIME is 0, then the session is currently waiting for the event
? SEQ#: Gets incremented with every wait of the session
? P1, P2, P3: Wait event specific details for the wait
? P1TEXT, P2TEXT, P3TEXT: Description of P1,P2,P3 for the given event
WAIT_TIME Meaning Waiting
>0 Time waited in the last wait (in 10 ms clock ticks) No
0 Session is currently waiting for this event Yes
-1 Time waited in the last wait was less than 10 ms No
-2 Timing is not enabled No
4、V$WAITSTAT(统计)
目的:a summary all block buffer waits since instance startup。适于查找buffer busy waits