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
												

cursor: pin S的更多相关文章

  1. library cache lock和cursor: pin S wait on X等待

    1.现象: 客户10.2.0.4 RAC环境,出现大量的library cache lock和cursor: pin S wait on X等待,经分析是由于统计信息收集僵死导致的.数据库在8点到9点 ...

  2. cursor pin S wait on X

    cursor pin S wait on X: 这是10.2版本提出的mutex(互斥)机制用来解决library cache bin latch争夺问题引入的新事件,是否使用这种机制受到隐含参数_k ...

  3. NDMCDB数据库hang住故障分析 - cursor: pin S wait on X

    问题描写叙述: 上午刚刚到办公室,就有监控人员邮件反馈,昨晚NDMCDB407数据库被重新启动过,让我分析一下数据库重新启动的原因.因为昨晚业务有版本号上线,所以短信警告关闭了,所以没有短信下发到我手 ...

  4. Cursor: Pin S Wait On X In The Top 5 Wait Events

    Wait Events , Posted in: Technical Track Tags: Group Blog Posts, Oracle, Technical Blog Lately, wait ...

  5. Resolving Issues of "Library Cache Pin" or "Cursor Pin S wait on X" (Doc ID 1476663.1)

    Doc ID 1476663.1) To Bottom In this Document   Purpose   Troubleshooting Steps   Brief Definition:   ...

  6. [20190322]测试相同语句遇到导致cursor pin S的疑问.txt

    [20190322]测试相同语句遇到导致cursor pin S的疑问.txt--//昨天测试遇到的情况,链接:http://blog.itpub.net/267265/viewspace-26388 ...

  7. [20190320]测试相同语句遇到导致cursor pin S的情况.txt

    [20190320]测试相同语句遇到导致cursor pin S的情况.txt --//前面测试链接:http://blog.itpub.net/267265/viewspace-2636342/-- ...

  8. cursor: pin S产生原理及解决方法

    转自:http://www.dbafree.net/?p=778 今天晚上在一个比较重要的库上,CPU严重的冲了一下,导致DB响应变慢,大量应用连接timeout,紧接着LISTENER就挂了,连接数 ...

  9. oracle动态采样导致数据库出现大量cursor pin s wait on x等待

    生产库中,突然出现了大量的cursor pin s wait on x等待,第一反应是数据库出现了硬解析,查看最近的DDL语句,没有发现DDL.那么有可能这个sql是第一次进入 在OLTP高并发下产生 ...

随机推荐

  1. 1001 Sum Problem [ACM刷题]

    这一段时间一直都在刷OJ,这里建一个博客合集,用以记录和分享算法学习的进程. github传送门:https://github.com/haoyuanliu/Online_Judge/tree/mas ...

  2. HDU 2639 Bone Collector II(01背包变型)

    此题就是在01背包问题的基础上求所能获得的第K大的价值. 详细做法是加一维去推当前背包容量第0到K个价值,而这些价值则是由dp[j-w[ i ] ][0到k]和dp[ j ][0到k]得到的,事实上就 ...

  3. Android 物理按键

    import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view. ...

  4. Zend框架2入门(二) (转)

    Zend框架2使用一个模块系统,和你组织内每个你的主应用程序特定代码模块.骨架提供的应用程序模块是用于提供引导,错误和路由配置到整个应用程序.它通常是用来提供应用水平控制器,比如说,应用程序的主页,但 ...

  5. WinSock IO模型 -- WSAEventSelect模型事件触发条件说明

    FD_READ事件 l  调用WSAEventSelect函数时,如果当前有数据可读 l  有数据到达时,并且没有发送过FD_READ事件 l  调用recv/recvfrom函数后,仍然有数据可读时 ...

  6. NYOJ-569最大公约数之和

    题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=569 此题目可以用筛选法的思想来做,但是用到一个欧拉函数 gcd(1,12)=1,gcd( ...

  7. asp.net微信开发第一篇----开发者接入

    在项目的根目录或者特定的文件夹内,创建一个ashx文件(一般处理程序文件),如图 public void ProcessRequest(HttpContext context) { context.R ...

  8. mysql_fetch_assoc() ,mysql_fetch_array() , mysql_fetch_row()的区别

    1. mysql_fetch_assoc() 函数从结果集中取得一行作为关联数组. 返回根据从结果集取得的行生成的关联数组,如果没有更多行,则返回 false. 输出: Array ( [LastNa ...

  9. 关于iOS应用管理之九宫格的坐标计算以及与UIScrollView的结合

    关于九宫格的布局以及坐标的计算,对于大多数的iOS初学者甚至有一定能力的学者来说都是一大难题,在此写者通过自己的开发经验以及多次应用,把自己的所学所得分享给大家,就通过应用管理来进行浅谈一二.     ...

  10. 工作流activiti-02事物控制、流程引擎创建

    使用activiti中有个很重要的问题就是需要保证事物的控制 activiti使用的是mybatis作为orm技术 封装了一系列的操作数据库操作  这也就是大家调用的api 操作的数据库表都是acti ...