Cursor: pin S wait on X

What is a ‘Cursor: pin S wait on X’ wait?

A cursor wait is associated with parsing in some form. A session may wait for this event when it is trying to get a mutex pin in Share mode but another session is holding the mutex on the same cursor in exclusive. Frequently, waits for ‘Cursor pin S wait on X’ is a symptom and not the cause. There may be underlying tuning requirements or knowing issues.

What case ‘Cursor: pin S wait on X’ waits?

First, ensure that the shared pool is sized correctly.

If the shared pool is under sized or under load generally, this may manifest itself as ‘Cursor pin S on X’. If Automatic Memory Management is being used then then thish should not normally.

Frequent Hard Parsing.

If the frequency of hard parsing is extremely high, then contention can case cursor on this pin.

High version counts

When version counts become excessive, a long chain of version needs to be examined and this can be leading to contention on this event.

How to diagnose the cause.

Run AWR and ADDM reports during the time that you see ‘Cursor: pin S wait on X’  waits and also collect baseline reports when you do not see the waits to make comparisons. The baseline shows us the typical ‘background’ concurrency and activity going on during the time of both the issue and the baseline and may help identify culprit SQLs with high version counts.

To gather this it is suggested to run AWR and ADDM for half an hour to an hour interval as following:

@?/rdbms/admin/awrrpt

@?/rdbms/admin/addmrpt

Sometimes system state dump is necessary to match known issues. For example, if there is not candidate SQL in AWR,  captureng holder or waiter processes in system state allows you to focus in on potential problems. Run system state when processes apper hung on ‘Cursor: pin S wait on X’ waits:

Non-RAC

sqlplus "/ as sysdba"

oradebug setmypid
oradebug unlimit
oradebug dump systemstate 266 wait 90 seconds
oradebug dump systemstate 266 wait 90 seconds
oradebug dump systemstate 266 quit

RAC

$ sqlplus ‘/ as sysdba‘
oradebug setmypid
oradebug unlimit
oradebug setinst all
oradebug -g all hanganalyze 4 oradebug -g all dump systemstate 267 quit

Errorstacks: Another way to obtain process information is with errorstack. Assuming you can identify a blocker, taking errorstacks will provide much the same information as systemstates but with a much reduced disk footprint for trace. Once the ospid of the blocker has been found, an errorstack can be generated:

$ sqlplus
SQL> oradebug setospid <p.spid from above> oradebug dump errorstack 3
<< wait 1min>>
oradebug dump errorstack 3
<< wait 1min>>
oradebug dump errorstack 3
exit

In particular, the stack from the resultant trace can be used to match known issues.
The system state and errorstacks are not easily readable; so a Service Request may need to be opened to read the files. 4. It is not always feasible to run system state dump. Thus, this note on finding the blocker can be used as well:

Furthermore, the following sqls can be ran to identify the waiters:

SELECT s.sid, t.sql_text
FROM v$session s, v$sql t
WHERE s.event LIKE ‘%cursor: pin S wait on X%‘ AND t.sql_id = s.sql_id

时间: 2024-10-12 20:15:24

Cursor: pin S wait on X的相关文章

【翻译自mos文章】找到&#39;cursor: pin S wait on X&#39; 等待事件的阻塞者session(即:持有者session)

找到'cursor: pin S wait on X' 等待事件的阻塞者session(即:持有者session) 来源于: How to Determine the Blocking Session for Event: 'cursor: pin S wait on X' (Doc ID 786507.1) 适用于: Oracle Database - Enterprise Edition - Version 10.2.0.1 to 11.2.0.3 [Release 10.2 to 11.2

cursor: pin S

OTN 解释如下: cursor: pin SA 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

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

问题描述: 上午刚刚到办公室,就有监控人员邮件反馈,昨晚NDMCDB407数据库被重启过,让我分析一下数据库重启的原因.由于昨晚业务有版本上线,所以短信警告关闭了,所以没有短信下发到我手机上,而且故障时相关人员也没有通知到我. 1     检查alert日志 从alert日志中,可以看到,先是在03:29时有一个job运行失败了: Fri Aug 22 03:29:29 2014 Errors in file/opt/oracle/diag/rdbms/ndmcdb/NDMCDB/trace/N

cursor: pin S wait on X数据库缓慢

应用反应说系统慢,时间不固定,现象不知道,就是慢.无奈只好登陆系统查查看了. 查看系统上现有的快照信息 SQL> col mintime for a30 SQL> col maxtime for a30 SQL> SQL> select min(snap_id) minid, max(snap_id) maxid, 2  to_char(min(begin_interval_time),'yyyy-mm-dd hh24:mi:ss') mintime, 3  to_char(max

关于cursor: pin S wait on X 和 library cache pin 及其他等待事件

cursor: pin S wait on X 也好,library cache pin 也罢,这都是shared pool 的等待事件,关于此类的等待事件,阅读的书有:<<oracle 内核技术揭秘>>,<<高级owi与oracle性能调整>> 其中,<<oracle 内核技术揭秘>> 是吕海波大师所著,吕大师也是我的OCM培训老师,在此向吕大师致敬. <<高级owi与oracle性能调整>> 是Oracle

enq: SQ – contention、cursor: pin S wait on X等事件引发的故障处理

事情已经过去一年,发生在15年1月份,某全国业务系统,实时的号码办理系统,收到短信告警,该系统断开连接.数据库出现大量enq: SQ – contention.cursor: pin S wait on X等事件,alert日志中出现大量的ORA-04031报错.进行flush share pool后进行了相关查询操作. 9点前后,活动会话数突然攀升,与alert日志在1月31号首次出现ORA-04031错误时间吻合 TO_CHAR(TRUNC(SA   COUNT(*) -----------

遇到cursor: pin S等待事件

背景: 主库:rac两个节点,每一个节点均是:8个逻辑cpu,16g内存 有dg备机,dg备机是单机:8个逻辑cpu,16g内存 主库rac由于存储微码升级,因此临时把db switchover到dg备机上跑了一天的业务,在备机承担业务的一天之中,v$session中有很多cursor: pin S等待事件,前台业务反馈很慢.呵呵,有时候软解析多了也不是好事. 而dg备机的配置相当于rac其中的一个节点,显然备机的容灾能力是不足的. 因此,当rac对应的存储微码升级之后,db switchove

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点期间,数据库两个节点都存在明显的cursor: pin S wait on X和library cache lock的等待: TOP 5 EVENT: Event Waits Time(s) Avg   Wait(ms) %   Total Call Time Wait   Class cursor

如何诊断cursor pin s wait on x 系列二

如何分析诊断收集信息 1.       查看AWR 报告中high paring 和high version部分内容 具体查看这几个部分的内容:'SQLordered by Parse Calls' or 'SQL ordered by Version Count' SQL ordered by Parse Calls 关于这部分中的sql 解析执行是否过高,或者能否减小来. SQL ordered by Version Count关于这部分中的high version sql ,需要找出为啥他