cursor pin S wait on X;
这是10.2版本提出的mutex(互斥)机制用来解决library cache bin latch争夺问题引入的新事件,是否使用这种机制受到隐含参数_kks_use_mutex_pin的限制,从10.2.0.2开始该参 数default为true,使用这种机制oracle是为了解决library cache bin latch的串行使用问题,但是mutex貌似还不是很稳定,在很多系统中会出现cursor: pin S wait on X等待事件 ,这个事件和mutex的使用有关,最近一客户受到cursor: pin S wait on X等待事件的困扰,出现cursor: pin S wait on X等待事件时通常等待比较严重,系统会出现hang,这个事件 的出现受到很多因素的影响: 在高并发的情况下:
1.sga自动管理,sga的频繁扩展和收缩
2.过渡硬解析,造成library cache中的cursor object被频繁的reload
3.bug doc描述
cursor: pin S wait on X
A session waits for this event when it is requesting a shared mutex pin and another session is holding an exclusive mutex pin on the same cursor object.
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 Sleeps 以下是11G测试: session 1:
--============================
SQL> select sid from v$mystat where rownum=1;
SID
----------
24
--创建测试表
SQL> create table t tablespace users as select *from dba_objects;
表已创建。
--验证系统是否使用mutex机制 SQL> SELECT nam.ksppinm NAME, val.ksppstvl VALUE
FROM x$ksppi nam, x$ksppsv val
WHERE nam.indx = val.indx
AND nam.ksppinm LIKE '%mutex%'
ORDER BY 1;
2 3 4 5
NAME VALUE
------------------------------ ----------
_kgl_mutex_wait_time 0 11G 默认值为0 SQL>
SQL> declare
2 v_string varchar2(100) := 'alter system flush shared_pool';
3 msql varchar2(200);
4 begin
5 loop
6 execute immediate v_string;
7 for i in 1 .. 100 loop
8 msql:='select object_id from t where object_id='||i;
9 execute immediate msql;
10 end loop;
11 end loop;
12 end;
13 /
--==============================
session 2:
SQL> select sid from v$mystat where rownum=1;
SID
----------
32
SQL> declare
2 v_string varchar2(100) := 'alter system flush shared_pool';
3 msql varchar2(200);
4 begin
5 loop
6 execute immediate v_string;
7 for i in 1 .. 100 loop
8 msql:='select object_id from t where object_id='||i;
9 execute immediate msql;
10 end loop;
11 end loop;
12 end;
13 /
--================================ 查看ASH监控:
BLOCKING_SESSION
12 2009070 24 14-3月 -01 10.45.34.268 下午 9kvh5ub3p290k cursor: pin S wait on X 32 select object_id from t where object_id=13 SELECT sid,
SUBSTR (event, 1, 30),
p1,
TO_CHAR(p1, 'xxxxxxxx') p1_16,
--P1RAW P1_16,
p2,
p3
FROM v$session_wait
WHERE sid in (32,12) SID SUBSTR(EVENT,1,30) P1 P1_16 P2 P3
---------- ------------------------------------------------------------ ---------- --------- ---------- ----------
12 rdbms ipc message 300 12c 0 0
32 cursor: pin S wait on X 272866798 10439dee 1572864 327680 select b.*, sq.sql_text
from v$session se,
v$sql sq,
(select a.*, s.sql_text
from v$sql s,
(select sid,
event,
wait_class,
p1,
p2raw,
to_number(substr(p2raw, 1, 4), 'xxxx') sid_hold_mutex_x
from v$session_wait
where event like 'cursor%') a
where s.HASH_VALUE = a.p1) b
where se.sid = b.sid
and se.sql_hash_value = sq.hash_value; SID EVENT WAIT_CLASS P1 P2RAW SID_HOLD_MUTEX_X SQL_TEXT SQL_TEXT
---------- -------------------- ---------- ---------- ---------------- ---------------- ---------- ----------
32 cursor: pin S wait o Concurrenc 3952272319 0000000000180000 0 select obj select obj
n X y ect_id fro ect_id fro
m t where m t where
object_id= object_id=
89 89

cursor pin S wait on X的更多相关文章

  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

    declare v_sql varchar2(200); begin loop v_sql :='select seq1.nextval from dual'; execute immediate v ...

  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. VIPServer VS LVS

    http://www.cnblogs.com/nanyangzp/p/5552725.html

  2. cocos2d-x项目过程记录(ios和android设备的适配)

    (原创作品,欢迎转载,注明出处,谢谢:http://www.cnblogs.com/binxindoudou/admin/EditPosts.aspx?postid=3213645) 1.原理分析的博 ...

  3. 在浏览器地址栏按回车、F5、Ctrl+F5刷新网页的区别--转

    其中,在地址栏按回车又分为两种情况.一是请求的URI在浏览器缓存中未过期,此时,使用Firefox的firebug插件在浏览器里显示的HTTP请求消息头如下: Host    192.168.3.17 ...

  4. windows下如何设置mysql环境变量

    方法一: windows下如何设置mysql环境变量 关键词: mysql, Setting Environment Variables, 环境变量设置 我的电脑->属性->高级-> ...

  5. C++继承:公有,私有,保护

    前言 无论是在平时学习中还是还做项目之时,主要用到的继承都是 public 公有继承,因此,对protected private两者继承都不大了解! 今天,在看<Effective C++ 3e ...

  6. Android实现网络多线程断点续传下载(转)

    本示例介绍在Android平台下通过HTTP协议实现断点续传下载. 我们编写的是Andorid的HTTP协议多线程断点下载应用程序.直接使用单线程下载HTTP文件对我们来说是一件非常简单的事.那么,多 ...

  7. yii2 and short_open_tag

    在看yii2的时候, 在main文件里看到了这样一段代码 <?= Yii::$app->language ?> 而我查看了php.ini里的配置, short_open_tag=Of ...

  8. 刚入门的easyui

    这两天看了下easyui的教学先说说自己的一些小小理解吧! ----在使用easyui中也遇到了一个问题 : Uncaught TypeError:cannot call method ‘offset ...

  9. PHP微信公众号 access_token缓存

    PHP创建access_token.json文件,将access_token 和 生成时间expires 保存在其中, {"access_token":"xxxx&quo ...

  10. 分页技术之PageDataSource类

    之前给大家介绍了分页技术之Gridview控件,今天给大家介绍另外一种分页技术,采用PageDataSource类 + Repeater控件来实现. 前台只需要拖出一个Repeater控件来绑定要显示 ...