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. php-redis扩展模块安装记录

    redis的安装可以参考:centos下部署redis服务环境的操作记录 下面记录下php-redis扩展模块的安装过程:php的安装目录是/Data/app/php5.6.26 下载phpredis ...

  2. C# 读取 Access 数据库表的例子

    using System;using System.Data;using System.Data.OleDb;using System.Collections.Generic;using System ...

  3. SKCropNode类

    继承自 SKNode:UIResponder:NSObject 符合 NSCoding(SKNode) NSCopying(SKNode) NSObject(NSObject) 框架 /System/ ...

  4. Android ImageView 点击更换头像

    首先搭建布局 主界面布局: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" ...

  5. 自定义控件 TextView 歌词 Lrc

    演示 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> < ...

  6. Android中ListView的优化

    第一种方法 重用了convertView,很大程度上的减少了内存的消耗.通过判断convertView是否为null,是的话就需要产生一个视图出来,然后给这个视图数据,最后将这个视图返回给底层,呈献给 ...

  7. [HAOI2006]聪明的猴子

    /* 找出能连通所有点的一棵树 是的最大的边最小 很显然就是最小生成树. 堆优化prim. */ #include<iostream> #include<cstring> #i ...

  8. SuperSocket快速入门(三):实现你的AppServer和AppSession

    什么是AppSession? AppSession 代表一个和客户端的逻辑连接,基于连接的操作应该定义于在该类之中.你可以用该类的实例发送数据到客户端,接收客户端发送的数据或者关闭连接.同时可以保存客 ...

  9. 用C#实现的条形码和二维码编码解码器

    本文主要介绍可以在C#中使用的1D/2D编码解码器.条形码的应用已经非常普遍,几乎所有超市里面的商品上面都印有条形码:二维码也开始应用到很多场合,如火车票有二维码识别.网易的首页有二维码图标,用户只需 ...

  10. 遍历std::list过程中删除元素后继续遍历过程

    std::list::erase Erase elements Removes from the list container either a single element (position) o ...