性能诊断与调优之V$--V$SESSION_WAIT_CLASS

1、V$SESSION_WAIT_CLASS View

            The view V$SESSION_WAIT_CLASS is similar to the V$SYSTEM_WAIT_CLASS view, but it gives session-level information for all sessions that are currently                           connected to the instance.

         V$SESSION_WAIT_CLASS视图类似于V$SYSTEM_WAIT_CLASS视图,但它提供了当前连接到数据库实例的所有会话级的            信息。包括了如下列

      SQL> desc V$SESSION_WAIT_CLASS 
      Name          Type         Nullable Default Comments 
      ------------- ------------ -------- ------- -------- 
      SID           NUMBER       Y                         
      SERIAL#       NUMBER       Y                         
      WAIT_CLASS_ID NUMBER       Y                         
      WAIT_CLASS#   NUMBER       Y                         
      WAIT_CLASS    VARCHAR2(64) Y                         
      TOTAL_WAITS   NUMBER       Y                         
      TIME_WAITED   NUMBER       Y 


2、How to Use V$SESSION_WAIT_CLASS View
            The V$SESSION_WAIT_CLASS view is useful when you know the SID (and maybe the
            SERIAL#) of the session that is connected to the instance. You can simply query this view for the
            SID to quickly find out what wait class has the most waits. Further drilling down using
            V$SESSION_EVENT view allows you to identify the wait events that may need further investigation.

         通过SID和serial# 在V$SESSION_WAIT_CLASS 视图中能够很快地查询出等待事件,然后理进一步通过查询                    V$SESSION_EVENT 视图找到相关等待事件的信息。

            If you identified a particular wait class as a potential problem by sampling the
            V$SYSTEM_WAIT_CLASS view as just shown, you can find out all the current sessions
            contributing to this wait class by querying V$SESSION_WAIT_CLASS view using the

            WAIT_CLASS#. Once the SID is known, you can find out the user and the SQL that is causing the waits.

         如果通过V$SYSTEM_WAIT_CLASS查到了问题,然后 通过WAIT_CLASS#列与V$SESSION_WAIT_CLASS 相关联,找出                 sid,再根据这个sid,就能跟踪出导致相关事件的SQL,进一步确定问题 。


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值