• cursor: pin S


    declare
    v_sql varchar2(200);
    begin
    loop
    v_sql :='select seq1.nextval from dual';
    execute immediate v_sql;
    end loop;
    end;
    
    
    SQL> select * from (select SAMPLE_TIME,
           SESSION_ID,  
           NAME,  
           P1,  
           P2,  
           P3  
      from v$active_session_history ash, v$event_name enm  
     where ash.event# = enm.event#)
     where rownum<10;  2    3    4    5    6    7    8    9  
    
    SAMPLE_TIME								    SESSION_ID NAME				      P1	 P2	    P3
    --------------------------------------------------------------------------- ---------- ------------------------------ ---------- ---------- ----------
    15-APR-14 07.24.15.366 PM							    22 cursor: pin S		      3155007310   75235328	196608
    15-APR-14 07.24.13.356 PM							    17 cursor: pin S		      3155007310	  2	196608
    15-APR-14 07.24.09.356 PM							    22 cursor: pin S		      3155007310   75235329	589824
    15-APR-14 07.24.07.346 PM							    17 cursor: pin S		      3155007310   75235328	196608
    15-APR-14 07.24.04.346 PM							    17 cursor: pin S		      3155007310	  2	589824
    15-APR-14 07.24.03.336 PM							    22 cursor: pin S		      3155007310   75235328	196608
    15-APR-14 07.24.01.336 PM							    22 cursor: pin S		      3155007310   75235328	196608
    15-APR-14 07.24.00.336 PM							    22 cursor: pin S		      3155007310	  1	589824
    15-APR-14 07.23.56.326 PM							    17 cursor: pin S		      3155007310   75235330	589824
    
    9 rows selected.
    
    P1 Hash value of cursor
    P2 Mutex value (top 2 bytes contains SID holding mutex in exclusive mode, and bottom two bytes usually hold the value 0)
    P3 Mutex where (an internal code locator) OR’d with Mutex Sleeps
    
    SELECT a.*, s.sql_text
      FROM v$sql s,
           (SELECT sid,
                   event,
                   wait_class,
                   p1 cursor_hash_value,
                   p2raw Mutex_value,
                   TO_NUMBER (SUBSTR (p2raw, 1, 8), 'xxxxxxxx') hold_mutex_x_sid
              FROM v$session_wait
             WHERE event LIKE 'cursor%') a
     WHERE s.HASH_VALUE = a.p1
    
    SQL> SELECT a.*, s.sql_text
      FROM v$sql s,
           (SELECT sid,
                   event,
                   wait_class,
                   p1 cursor_hash_value,
                   p2raw Mutex_value,
                   TO_NUMBER (SUBSTR (p2raw, 1, 8), 'xxxxxxxx') hold_mutex_x_sid
              FROM v$session_wait
             WHERE event LIKE 'cursor%') a
     WHERE s.HASH_VALUE = 3155007310;  2    3    4    5    6    7    8    9   10   11  
    
           SID EVENT			  WAIT_CLASS							   CURSOR_HASH_VALUE MUTEX_VALUE      
    
    HOLD_MUTEX_X_SID SQL_TEXT
    ---------- ------------------------------ ---------------------------------------------------------------- ----------------- ---------------- --------------
    
    -- --------------------
          1148 cursor: pin S		  Concurrency								  3155007310 0000000000000002		     
    
    0 select seq1.nextval from dual
    当看到系统有很多session等待cursor: pin S事件的时候,要么是CPU不够快,要么是某个SQL的并行执行次数太多了而导致在child cursor上的mutex操作争用。如果是Capacity的问题,则可以升级硬件。如果是因为SQL的并行太多,则要么想办法降低该SQL执行次数,要么将该SQL复制成N个其它的SQL
    cursor: pin S A session waits on this event when it wants to update a shared mutex pin and another session is currently in the process of updating a shared mutex pin for the same cursor object. This wait event should rarely be seen because a shared mutex pin update is very fast.(Wait Time: Microseconds)
    Parameter Description
    
    P1 Hash value of cursor
    P2 Mutex value (top 2 bytes contains SID holding mutex in exclusive mode, and bottom two bytes usually hold the value 0)
    P3 Mutex where (an internal code locator) OR’d with Mutex Sleep
    


    
                                        
    
  • 相关阅读:
    (译) 在AngularJS中使用的表单验证功能
    TypeError: Cannot red property 'style' of null 错误解决
    Velocity CheckingForNull
    推荐系统(Recommendation system )介绍
    python 时间戳和日期相互转换
    Markdown 语法的简要规则
    mpvue + 微信小程序 picker 实现自定义多级联动 超简洁
    微信小程序 上传图片并等比列压缩到指定大小
    vue路由的两种模式,hash与history的区别
    修改浏览器url地址或者参数 , 实现不刷新页面
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13352341.html
Copyright © 2020-2023  润新知