ORACLE # 查看最近1小时的 Top 20 等待事件

SELECT * FROM (
    SELECT
        h.event "Wait Event",
        SUM(h.wait_time + h.time_waited)/100000 "Total Wait Time"
        FROM v$active_session_history h,
             v$event_name e
    WHERE h.sample_time < (SELECT MAX(sample_time)
                            FROM v$active_session_history)
        AND h.sample_time > (SELECT MAX(sample_time) - 1/24
                            FROM v$active_session_history)
        AND h.event_id = e.event_id
        AND e.wait_class <> 'IDLE'
    GROUP BY h.event
    ORDER BY 2 DESC)
WHERE ROWNUM <=20;

Wait Event                               | Total Wait Time
---------------------------------------- | ---------------
db file sequential read                  |      3728.36995
direct path read                         |      2334.23797
log file sync                            |       580.71175
cursor: pin S wait on X                  |       521.31362
read by other session                    |       356.59181
db file parallel write                   |       261.61812
direct path write                        |       232.42318
db file scattered read                   |        197.4875
direct path write temp                   |       170.51093
log file parallel write                  |       145.52274
gc buffer busy acquire                   |       126.09249
gc current block 2-way                   |       122.96468
gc current block busy                    |        84.58933
log file sequential read                 |        73.03717
gc current grant busy                    |        69.48569
db file parallel read                    |        55.68226
reliable message                         |        54.25905
gc cr grant 2-way                        |        38.12883
gcs drm freeze in enter server mode      |        35.42488
gc cr block busy                         |        35.39542
Elapsed: 00:00:03.53
SQL>

点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注