分散式引起的cursor: pin S wait on X 事件一次問題處理
東南亞某國,系統A已上線好幾年,資料量較小,一直執行正常,4月22號同事反應
系統處在hang的狀態,一啟動,就有好多session . 系統基本不用。
OS:suse10
DBMS:11.1.0.7
ps -ef|grep ora|wc -l 發現程式數一直在增長
執行sql
-- 查詢當前會話資訊
select t3.sql_id, t3.sql_text, t1.SID, t1.SERIAL#, t1.STATUS, t1.PROGRAM, t1.LOGON_TIME, t1.EVENT, t1.SECONDS_IN_WAIT, t2.SPID
from v$session t1,
v$process t2,
(select sql_id, sql_text
from v$sql
group by sql_id, sql_text) t3
where t1.paddr = t2.addr
and t1.status = 'ACTIVE'
and t1.sql_id = t3.sql_id(+)
order by sql_text;
select t3.sql_id, t3.sql_text, t1.SID, t1.SERIAL#, t1.STATUS, t1.PROGRAM, t1.LOGON_TIME, t1.EVENT, t1.SECONDS_IN_WAIT, t2.SPID
from v$session t1,
v$process t2,
(select sql_id, sql_text
from v$sql
group by sql_id, sql_text) t3
where t1.paddr = t2.addr
and t1.status = 'ACTIVE'
and t1.sql_id = t3.sql_id(+)
order by sql_text;
發現大量的cursor: pin S wait on X等待事件
74c1hdswksgyt | select id,name from V_NE_NETYPE | 502 | 2 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:16 | single-task message |
gts5km94cpd3f | select id,name from v_ne_netype t | 515 | 2 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:16 | cursor: pin S wait on X |
gts5km94cpd3f | select id,name from v_ne_netype t | 506 | 2 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:16 | single-task message |
gts5km94cpd3f | select id,name from v_ne_netype t | 523 | 2 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:15 | cursor: pin S wait on X |
6ua7g9w10tnrj | select id,name from v_ne_netype where id='20' | 520 | 2 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:16 | cursor: pin S wait on X |
6ua7g9w10tnrj | select id,name from v_ne_netype where id='20' | 531 | 2 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:15 | cursor: pin S wait on X |
6ua7g9w10tnrj | select id,name from v_ne_netype where id='20' | 530 | 2 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:15 | cursor: pin S wait on X |
6ua7g9w10tnrj | select id,name from v_ne_netype where id='20' | 526 | 4 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:15 | cursor: pin S wait on X |
6ua7g9w10tnrj | select id,name from v_ne_netype where id='20' | 525 | 2 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:15 | cursor: pin S wait on X |
6ua7g9w10tnrj | select id,name from v_ne_netype where id='20' | 18 | 16 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:16 | cursor: pin S wait on X |
6ua7g9w10tnrj | select id,name from v_ne_netype where id='20' | 508 | 2 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:16 | cursor: pin S wait on X |
6ua7g9w10tnrj | select id,name from v_ne_netype where id='20' | 505 | 2 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:16 | cursor: pin S wait on X |
6ua7g9w10tnrj | select id,name from v_ne_netype where id='20' | 495 | 2 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:16 | single-task message |
cb8d7tmyz0gau | select id,name from v_ne_netype where id='30' | 524 | 2 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:15 | single-task message |
a7k5va9c6x21n | select id,name from v_ne_netype where 1=1 | 513 | 7 | ACTIVE | JDBC Thin Client | 2013/4/22 17:15:16 | cursor: pin S wait on X |
cursor: pin S wait on X 這是這周來第二次遇到此事件,上次是因為系統bug
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)
引起這個等待事件有幾個原因
1. 硬解析太高
2. shared_pool 大小
3. bug
第一個原因,系統已經運好幾年了,雖然很多沒有繫結變數,但也不會這麼嚴重
調大了shared_pool
alter system set shared_pool_size=2g scope=both;
依然沒有好轉
出了awr 報告
在
SQL ordered by Parse Calls
裡發現
有一個這個sql
begin :id := sys.dbms_transaction.local_transaction_id; end;
被解析1400多次。
這個處理分散式事務的一個application ,諮詢同事有無分散式資料庫的使用,比如dblink, 被告知只有webservice 沒有dblink.(其實是有的,這裡誤導了我)
再回到開始在等待的sql裡找出一
select id,name from v_ne_netype where id='20' 直接hang住, 不執行。
再問同事,v_ne_netype 是由一個dblink 的檢視。 此dblink 指向系統B
此時的B 透過plsql 已不能正常聯接。
原因找到
登陸B 系統,檢視其監聽,命令響應很慢。不能關閉,也不能重啟。
日誌也沒有。 kill 掉監聽程式,重啟監聽。 B系統正常。 A系統也正常。
原因:B系統因為一些原因,監聽異常,不能正確解析sql ,引發的聯鎖反應。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8013558/viewspace-759083/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 記一次cursor pin s wait on X的處理AI
- cursor: pin S wait on X等待事件的處理過程AI事件
- Cursor pin S wait on X 事件AI事件
- 【徵文】cursor: pin S wait on X等待事件的處理過程AI事件
- cursor: pin S wait on X等待事件。AI事件
- 一次cursor: pin S wait on X事件的跟蹤AI事件
- cursor pin S wait on XAI
- cursor: pin S wait on XAI
- cursor:pin S wait on XAI
- oracle等待事件之cursor:pin S wait on XOracle事件AI
- cursor: pin S wait on X等待事件模擬AI事件
- cursor: pin S wait on X等待事件模擬(轉)AI事件
- 【故障】cursor: pin S wait on X等待事件大量出現AI事件
- cursor: pin S wait on X模擬AI
- cursor:pin S wait on X故障診分析AI
- cursor: pin S wait on X等待實驗二AI
- cursor: pin S 等待事件事件
- library cache lock和cursor: pin S wait on X等待AI
- AWR報告實戰之cursor:pin S wait on XAI
- zt_小荷_記得cursor pin s wait on xAI
- cursor: pin S模擬與處理
- [20170707]cursor: pin S wait on X(10G)AI
- latch: row cache objects 和cursor: pin S wait on X共同出現ObjectAI
- 【新炬網路名師大講堂】cursor: pin S wait on X模擬AI
- Trouble shooting for Pin S wait on XAI
- [20180301]模擬cursor pin S wait on X.txtAI
- 解決RAC節點因cursor: pin S wait on X無法登陸案例一則AI
- 等待事件Cursor: Pin S Wait On X和Library Cache Load Locks可能意味著過度的記憶體調整事件AI記憶體
- sql version count引發cursor:pin s wait x及library cache latch library cache lockSQLAI
- 記一次row cache lock引起的效能問題分析處理
- 學習Oracle核心(cursor: pin S)Oracle
- Library cache pin問題的處理過程
- 遭遇cursor:pin x等待事件定位阻塞會話診斷過程事件會話
- 'cursor:mutex ..'/ 'cursor:pin ..'/ 'library cache:mutex ..'型別的等待事件Mutex型別事件
- ORACLE懸疑分散式事務問題處理Oracle分散式
- attachEvent()註冊事件處理函式this指向問題事件函式
- 一次efi的問題處理
- 常見的wait等待事件及處理AI事件