zoukankan      html  css  js  c++  java
  • Oracle性能视图v$session_event字段说明

    查询session等待的事件

    select s.sid,
    s.username,
    s.program,
    s.status,
    se.event, --等待时间的名称
    se.total_waits, --会话等待时间的总数
    se.total_timeouts, --会话超时事件总数
    se.time_waited, --等待事件的总事件(百分之一秒)
    se.average_wait --事件等待的平均事件(百分之一秒)
    from v$session s, v$session_event se
    Where s.sid = se.sid
    And se.event not like 'SQL*Net%'
    And s.status = 'ACTIVE'
    And s.username is not null

    v$session_event里有些字段不清楚,特意查询了下:

    v$session_event:

    v$session_event 记录了session自启动以来所有的等待事件。

    1. SQL> desc v$session_event  
    2.  Name                                      Null?    Type  
    3.  ----------------------------------------- -------- ----------------------------  
    4.  SID                                                NUMBER      会话ID  
    5.  EVENT                                              VARCHAR2(64)    等待事件的名称  
    6.  TOTAL_WAITS                                        NUMBER      会话等待事件总数  
    7.  TOTAL_TIMEOUTS                                     NUMBER      会话超时事件总数  
    8.  TIME_WAITED                                        NUMBER      等待事件的总时间(百分之一秒)  
    9.  AVERAGE_WAIT                                       NUMBER      事件等待的平均时间(百分之一秒)  
    10.  MAX_WAIT                                           NUMBER      最大等待时间(百分之一秒)  
    11.  TIME_WAITED_MICRO                                  NUMBER      等待事件的总时间(微秒)  
    12.  EVENT_ID                                           NUMBER      等待事件的标识符  
    13.  WAIT_CLASS_ID                                      NUMBER      等待事件的类标识符  
    14.  WAIT_CLASS#                                        NUMBER      等待事件的类的唯一编号  
    15.  WAIT_CLASS                                         VARCHAR2(64)    等待事件类的名称

    v$session_event 记录了当前session的等待事件,这些信息最终被累积进入v$system_event视图。

    顺便记录下v$system_event视图

    v$system_event:

    v$system_event 提供了自实例启动后各个等待事件的概括。

    1. SQL> desc v$system_event  
    2.  Name                                      Null?    Type  
    3.  ----------------------------------------- -------- ----------------------------  
    4.  EVENT                                              VARCHAR2(64)    等待事件的名称  
    5.  TOTAL_WAITS                                        NUMBER      等待事件总数  
    6.  TOTAL_TIMEOUTS                                     NUMBER      超时事件总数  
    7.  TIME_WAITED                                        NUMBER      等待事件的总时间(百分之一秒)  
    8.  AVERAGE_WAIT                                       NUMBER      事件等待的平均时间(百分之一秒)  
    9.  TIME_WAITED_MICRO                                  NUMBER      等待事件的总时间(微秒)  
    10.  EVENT_ID                                           NUMBER      等待事件的标识符  
    11.  WAIT_CLASS_ID                                      NUMBER      等待事件的类标识符  
    12.  WAIT_CLASS#                                        NUMBER      等待事件的类的唯一编号  
    13.  WAIT_CLASS                                         VARCHAR2(64)    等待事件类的名称  


    查看系统的各项等待,按等待事件总数排序

      1. SQL> select event,total_waits,total_timeouts,time_waited,average_wait from v$system_event order by total_waits desc;  
      2.   
      3. EVENT                                                            TOTAL_WAITS TOTAL_TIMEOUTS TIME_WAITED AVERAGE_WAIT  
      4. ---------------------------------------------------------------- ----------- -------------- ----------- ------------  
      5. rdbms ipc message                                                      20927          20313     6532187       312.14  
      6. db file sequential read                                                 6831              0        2957          .43  
      7. control file sequential read                                            6445              0          27            0  
      8. jobq slave wait                                                         2298           2192      673056       292.89  
      9. control file parallel write                                             2182              0        1670          .77  
      10. pmon timer                                                              2128           2125      617029       289.96  
      11. log file parallel write                                                  812              0        1482         1.82  
      12. db file scattered read                                                   515              0         357          .69  
      13. Streams AQ: qmn coordinator idle wait                                    452            227      611876      1353.71  
      14. Streams AQ: qmn slave idle wait                                          224              0      610886      2727.17  
      15. virtual circuit status                                                   211            210      615410      2916.63  
      16.   
      17. EVENT                                                            TOTAL_WAITS TOTAL_TIMEOUTS TIME_WAITED AVERAGE_WAIT  
      18. ---------------------------------------------------------------- ----------- -------------- ----------- ------------  
      19. log file sync                                                            116              0         365         3.14  
      20. dispatcher timer                                                         105            105      610962      5818.68  
      21. LGWR wait for redo copy                                                   87              0           1          .01  
      22. SQL*Net message to client                                                 85              0           0            0  
      23. SQL*Net message from client                                               84              0      284450      3386.31  
      24. os thread startup                                                         32              0         254         7.93  
      25. SQL*Net more data to client                                               26              0           0            0  
      26. smon timer                                                                26             20      578859     22263.82  
      27. direct path read                                                          18              0           0            0  
      28. rdbms ipc reply                                                           14              0          97         6.92  
      29. latch: shared pool                                                        10              0           3          .29  
      30.   
      31. EVENT                                                            TOTAL_WAITS TOTAL_TIMEOUTS TIME_WAITED AVERAGE_WAIT  
      32. ---------------------------------------------------------------- ----------- -------------- ----------- ------------  
      33. read by other session                                                      9              0         145        16.15  
      34. SQL*Net break/reset to client                                              9              0           0          .04  
      35. library cache load lock                                                    7              0          21         2.93  
      36. log file single write                                                      7              0           2          .24  
      37. log file sequential read                                                   7              0           8         1.18  
      38. direct path write                                                          6              0           0            0  
      39. latch free                                                                 5              0         154        30.85  
      40. direct path read temp                                                      3              0           0            0  
      41. enq: CF - contention                                                       3              0          46        15.24  
      42. cursor: pin S wait on X                                                    3              3           3         1.09  
      43. JS external job                                                            3              0         197        65.83  
      44.   
      45. EVENT                                                            TOTAL_WAITS TOTAL_TIMEOUTS TIME_WAITED AVERAGE_WAIT  
      46. ---------------------------------------------------------------- ----------- -------------- ----------- ------------  
      47. enq: PR - contention                                                       3              0          13         4.45  
      48. Streams AQ: qmn coordinator waiting for slave to start                     2              0           7         3.64  
      49. Streams AQ: waiting for time management or cleanup tasks                   2              1       77111     38555.65  
      50. instance state change                                                      2              0           0          .01  
      51. latch: redo allocation                                                     2              0           0          .05  
      52. latch: cache buffers lru chain                                             2              0           0          .07  
      53. latch: library cache                                                       1              0           0          .09  
      54. buffer busy waits                                                          1              0           0           .4  
      55. control file heartbeat                                                     1              1         391       390.92  
      56. reliable message                                                           1              0           1          .58  
      57.   
      58. 已选择43行。  

     

  • 相关阅读:
    2491 玉蟾宫
    1704 卡片游戏
    1020 孪生蜘蛛
    1215 迷宫
    3149 爱改名的小融 2
    1316 文化之旅 2012年NOIP全国联赛普及组
    1664 清凉冷水
    157. [USACO Nov07] 奶牛跨栏
    [SCOI2005]繁忙的都市
    【NOIP2014模拟赛No.1】我要的幸福
  • 原文地址:https://www.cnblogs.com/gary-bao/p/4258937.html
Copyright © 2011-2022 走看看