Troubleshooting 'cursor: pin S wait on X' waits. (文档 ID 1349387.1) | ![]() | ![]() |

In this Document
APPLIES TO:Oracle Database - Enterprise Edition - Version 10.2.0.1 and laterInformation in this document applies to any platform. ***Checked for relevance on 10-June-2013*** PURPOSEThe purpose of this article is to help troubleshoot 'Cursor: pin S wait on X' waits. TROUBLESHOOTING STEPSWhat 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 pin on the same cursor object 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 known issues. What causes 'Cursor: pin S wait on X' waits?
How to diagnose the cause. Obtain information and diagnostics to help locate the cause.
SQL>@$ORACLE_HOME/rdbms/admin/awrrpt.sql
SQL>@$ORACLE_HOME/rdbms/admin/addmrpt.sql 2. Sometimes system state dump is necessary to match known issues. For example, if there is no obvious candidate SQL in AWR, capturing holder or waiter processes in systemstate allows you to focus in on potential problems. Run system state when processes appear hung on 'Cursor: pin S wait on X' waits :
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 (b) RAC
$ sqlplus '/ as sysdba'
oradebug setmypid oradebug unlimit oradebug setinst all oradebug -g all hanganalyze 4 oradebug -g all dump systemstate 267 quit 3. 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 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.
Document 786507.1 How to Determine the Blocking Session for Event: 'cursor: pin S wait on X'
5. 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 6. In 11g RAC, there is another less resource intensive tool that can be used when compared with taking system state dumps:
Document 459694.1 Procwatcher: Script to Monitor and Examine Oracle DB and Clusterware Processes
How to Examine the Diagnostics. 1. Look for high parsing and high version counts from AWR. SQL ordered by Parse Calls
* Total Parse Calls: 2,935,390
* Captured SQL account for 95.6% of Total Parse Calls Executions % Total Parses SQL Id SQL Module SQL Text 668,174 668,014 22.76 gpkdazvcfwkv select DATA_TABLE (... 667,440 668,234 22.74 5p9vjzht9jqb INSERT INTO DATA_TABLE (DATA_I... From this list, investigate the top SQLs to determine whether this volume of parse calls is excessive or can be reduced. SQL ordered by Version Count
* Only Statements with Version Count greater than 20 are displayed
Version Count Executions SQL Id SQL Module SQL Text 277 392,737 30d5a6v16mpb select FLOW_CONTEXT (... 78 131,104 7c0gj35488xs INSERT INTO PROJECT (DOC_ID, ... From this list, investigate the SQLs with the high version count. What are the reasons that these statements are not shared? Can this be addressed? Potential Solutions 1. Tune sqls with high parse count by either investigating the application or the sql.
Document 62143.1 Understanding and Tuning the Shared Pool
Also remember if the shared pool is flushed, then sqls will need to be hard parsed. This also may cause mutex waits. So make sure sqls are in memory once hard parsed and monitor to see if mutex waits are alleviated.
Document 438755.1 Formated V$SQL_SHARED_CURSOR Report by SQLID or Hash Value
Document 296377.1 Troubleshooting: High Version Count Issues There are some notable bugs where high version counts have been a factor:
Document 1057392.8 Bug 10157392 - High version counts for SQL with binds (BIND_MISMATCH)
Document 9689310.8 Bug 9689310 - Excessive child cursors / high VERSION_COUNT / OERI:17059 due to bind mismatch 3. For more known defects, please go to following note and click on known bugs:
Document 1298015.1 WAITEVENT: "cursor: pin S wait on X" Reference Note
Click on the version that applies and review bug or bugs with similar scenario.
Document 1291879.1 Oracle Database Patch Set Update 11.2.0.2.2 Known Issues
Troubleshooting Other IssuesFor guidance troubleshooting other performance issues see:
Document 1377446.1 Troubleshooting Performance Issues
Community Discussions... |
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29656486/viewspace-1160421/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29656486/viewspace-1160421/