2.2.2 Wait Types
V$SYSTEM_EVENT shows the total number of waits and timeouts, and the total waiting time recorded for each type of event, accumulated for all processes over the life of the instance. It is normal to order the events waited for in descending order of the total time waited, as an indicator of the potential severity of each type of wait.
V$SYSTEM_EVENT显示出在instance生命期中所以进程的每一个事件累积的等待次数,超时次数和总共等待时间。按降序排列的总共等待时间一般作为每个等待的潜在重要的指示器However, the total time waited is really only meaningful for those that indicate
waiting for resources. If processes have been waiting because they have no work
to do, then the time waited is immaterial. If they have been waiting for routine
operations, such as disk I/O, then the total time waited will depend on the
workload. In such cases, the average time waited is much more interesting than
the total time waited.
然而,the total time waited紧紧在资源等待的情况下是有意义的。如果进程一直在等待是因为没有事可作,那么the time waited是无关紧要的,如果是在等待常规的操作如磁盘I/O,那么the total time waited依赖工作量。在这种情况下,the average time waited比the total time waited更能说明问题。
This classification of wait types into idle waits, routine waits, and resource waits
is vital to a correct understanding of the wait statistics. Accordingly, APT has
separate scripts for resource waits and routine waits, and ignores idle waits
altogether. The routine_waits.sql script shows only the average time waited for
each type of routine wait. The resource_waits.sql script (see Example 2.1) shows
the types of resources waited for in descending order of the total time waited, but
also shows the average time waited.
把等待类型分为idle waits, routine waits和resource waits对正确认识等待统计量是重要的。
因此APT有一个把等待事件分为resource waits ,routine waits和 ignores idle waits的脚本。这个resource_waits.sql脚本按the total time waited降序显示资源等待的事件,并且显示the average time waited。
Example 2.1. Sample Output from resource_waits.sql
SQL> @resource_waits
---------------------------------------- ----------- ------------
write complete waits 3816218 212.02
buffer busy waits 1395921 21.79
enqueue 503217 529.15
log file switch completion 144263 90.11
latch free 31173 0.61
free buffer waits 19352 302.38
row cache lock 876 73.00
library cache pin 131 18.71
library cache load lock 29 2.64
non-routine log file syncs 0 2.32
The average time waited reported by resource_waits.sql is not what you might
expect. Because of timeouts, a single logical wait for a resource may be reported
as a series of distinct waits, each of which would have timed out, except the last.
The number of logical waits is approximately the number of times the waiting
process was posted to end its wait—that is, the number of distinct waits, minus
the number of waits that timed out. The average time waited for each logical wait
is a better indication of the time taken to resolve resource waits, than the average
time for each component wait. Therefore, that is what this script reports for all
resource waits except latch free waits. It is normal for latch free waits to time out,
because latch wait posting is the exception, not the rule. Also, apart from latch
contention, it is normal for the latch to be obtained after a timeout. So the
average time waited for each distinct wait is a better indication of the duration of
latch free waits.
resource_waits.sql结果中的the average time waited不是你期望的值。因为timeouts,等待资源的逻辑等待可能报告为一般连续不同的等待,除了最后一个,其他的都是超时。逻辑等待数大概是等待进程被指明结束等待――不同等待数,减去超时数。对每个逻辑等待来说,The average time waited是一个更好的解决资源等待的时间指示器,比各个component wait.的the average time。因此这个脚本报告所以资源等待除了latch free等待。latch free一般是超时,因为latch 等待posting是例外,除了latch争用,一般latch在超时后会获得。所以………
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/51726/viewspace-65962/,如需转载,请注明出处,否则将追究法律责任。