在AWR中的等待事件中的CPU time总是弄不清,不过今天总算弄清楚了。
官方文档Performance Tuning Guide/5 Automatic Performance Statistics:
This statistics represents the total time spent in database calls and is a indicator of the total instance workload. It is calculated by aggregating the CPU and wait times of all sessions not waiting on idle wait events (non-idle user sessions).
DB Time= CPU time + 非空闲wait time;
在等待TOP5的等待事件中,CPU time不是等待事件,而是实际消耗CPU的时间。%Total call Time 是这么计算的, 如在等待事件中的CPU time 91.9% = 6,527/(118.40*60)。
还有一点可以总结:通过这两个时间,我们就可以知道数据库到底是负载高还是等待事件严重。
Snap Id | Snap Time | Sessions | Cursors/Session | |
---|---|---|---|---|
Begin Snap: | 20684 | 06-2月 -13 14:00:45 | 377 | 13.6 |
End Snap: | 20688 | 06-2月 -13 18:00:35 | 354 | 15.0 |
Elapsed: | 239.83 (mins) | |||
DB Time: | 118.40 (mins) |
Event | Waits | Time(s) | Avg Wait(ms) | % Total Call Time | Wait Class |
---|---|---|---|---|---|
CPU time | 6,527 | 91.9 | |||
db file sequential read | 332,367 | 324 | 1 | 4.6 | User I/O |
log file parallel write | 32,029 | 286 | 9 | 4.0 | System I/O |
log file sync | 31,044 | 283 | 9 | 4.0 | Commit |
db file parallel write | 11,633 | 71 | 6 | 1.0 | System I/O |