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. C#获取时间属于第几周

    int getWeek(DateTime dt)    {        DateTime time = Convert.ToDateTime(dt.ToString("yyyy" ...

  2. Java 编程的动态性, 第4部分: 用 Javassist 进行类转换--转载

    讲过了 Java 类格式和利用反射进行的运行时访问后,本系列到了进入更高级主题的时候了.本月我将开始本系列的第二部分,在这里 Java 类信息只不过是由应用程序操纵的另一种形式的数据结构而已.我将这个 ...

  3. mysql 创建数据库使用默认字符集(备忘)

    GBK: create database test2 DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci; UTF8: CREATE DATABASE ` ...

  4. SharePoint中获取当前登录的用户名几种方式

    第一种方法: System.Web.HttpContext.Current.User.Identity.Name.ToString();或者: SPContext.Current.Site.OpenW ...

  5. (转)asp.net 使用cookie完成记住密码自动登录

     代码如下 复制代码 string username = this.txtUserName.Text;//用户名        string password = this.txtPassword.T ...

  6. Design Pattern —— Prototype /Template Method/Iterator/Composite/Bridge

    Prototype /Template Method/Iterator/Composite/Bridge 为什么把这五种设计模式放一起呢,没什么太高大上的原因,就是因为这五种模式JAVA开发最基本的特 ...

  7. spring 配置触发器 (类似于定时任务)

    为什么会看这个? 发现项目中有的service中的方法没有地方调用.经查,发现在web.xml中加载的spring的配置文件中配置了这个方法, 经查这种方式是触发器,会定时执行,只需要配置一下.可以设 ...

  8. 安装beautifulsoup的奇怪问题

    以前用的python2.7,改成3.4以后就重新下载了beatifulsoup4.解压到c:\Python34后.在cmd界面执行python setup.py install安装完成后.想看看安装成 ...

  9. Linux下Fork与Exec使用

    Linux下Fork与Exec使用   一.引言 对于没有接触过Unix/Linux操作系统的人来说,fork是最难理解的概念之一:它执行一次却返回两个值.fork函数是Unix系统最杰出的成就之一, ...

  10. js中apply和call的用法 以及apply的妙用 (来自网络)

    apply:方法能劫持另外一个对象的方法,继承另外一个对象的属性. Function.apply(obj,args)方法能接收两个参数obj:这个对象将代替Function类里this对象args:数 ...