頂級等待事件:

edwardking888發表於2010-04-13

 一個重要檢視v$system_event,該檢視記錄的是資料庫自啟動以來等待事件的彙總。通過查詢該檢視,就可以快速獲得資料庫等待事件的總體概況,瞭解資料庫執行的基本狀態:

sys@CCDB> select *
  2  from (select event,time_waited
  3        from v$system_event
  4        order by time_waited desc)
  5  where rownum < 11;
EVENT                                                            TIME_WAITED
---------------------------------------------------------------- -----------
rdbms ipc message                                                 6207605140
DIAG idle wait                                                    1033906433
virtual circuit status                                             517841938
dispatcher timer                                                   517838356
Streams AQ: qmn coordinator idle wait                              517837446
Streams AQ: qmn slave idle wait                                    517833505
fbar timer                                                         517818073
smon timer                                                         517784201
pmon timer                                                         517766357
Streams AQ: waiting for time management or cleanup tasks           517763231
10 rows selected.

以上是一個測試環境中的Top 10等待事件。

在Oracle的Statspack Report中,有一部分資訊為Top 5 Wait Events(在Oracle 9i中更改為Top 5 Time Events),這部分資訊是來自v$system_event檢視的取樣。

以下是一個Statspack的診斷報告:

Database    DB Id    Instance     Inst Num  Startup Time   Release     RAC
~~~~~~~~ ----------- ------------ -------- --------------- ----------- ---
          3313878466 ccdb                1 26-Jan-10 16:32 11.1.0.6.0  NO

Host                             Name             Platform                CPUs
Cores Sockets   Memory (G)
~~~~ ---------------- ---------------------- ----- ----- ------- ------------
     test7            Linux 64-bit for AMD       4     2       2          2.0

Snapshot       Snap Id     Snap Time      Sessions Curs/Sess Comment
~~~~~~~~    ---------- ------------------ -------- --------- -------------------
Begin Snap:          1 27-Mar-10 15:32:01       24       1.5
  End Snap:          2 27-Mar-10 15:32:19       25       1.4
   Elapsed:           0.30 (mins)
   DB time:           0.02 (mins)                               DB CPU:
      0.02 (mins)

Cache Sizes            Begin        End
~~~~~~~~~~~       ---------- ----------
    Buffer Cache:       224M              Std Block Size:         8K
     Shared Pool:       356M                  Log Buffer:     6,209K
... ...
Top 5 Timed Events                                                    Avg %Total
~~~~~~~~~~~~~~~~~~                                                   wait   Call
Event                                            Waits    Time (s)   (ms)   Time
----------------------------------------- ------------ ----------- ------ ------
CPU time                                                         1          53.0
control file parallel write                         20           0     14   19.3
log file switch completion                           2           0     97   13.1
log file parallel write                              8           0     18    9.6
os thread startup                                    1           0     26    1.7
          -------------------------------------------------------------

這裡的Top 5 Timed Events是診斷的重要依據。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8183550/viewspace-659565/,如需轉載,請註明出處,否則將追究法律責任。

相關文章