Cursor pin S wait on X 事件
V$SESSION中的P1, P2,P3定義:
P1: 遊標的hash值
P2: 頭兩個位元組表示holding Mutex SID, 後面兩個位元組通常為0
P3: Mutex where an internal code locator 或 with mutex sleeps
通過v$mutex_sleep可以看到mutex資訊
select * from v$mutex_sleep
MUTEX_TYPE LOCATION SLEEPS WAIT_TIME
-------------------------------- ---------------------------------------- ---------- ----------
Cursor Parent kksfbc [KKSPRTLOC2] 42 49
.......................................
Cursor Pin kksSetBindType [KKSCHLPIN3] 20 378277
Cursor Pin kkslce [KKSCHLPIN2] 1819288987 3378316655
從以上檢視中發現一個mutex_type cursor pin有嚴重的sleeps和等待。
select sid, p2raw from v$session where event='cursor: pin S wait on X'
發現所有的sid 的p2raw值相同,通過擷取p2raw頭兩位,轉化成十進位制,獲得holding mutext的SID,然後找出對應的程式將其kill。
在檢視holding SID與blocked SID關係的時候,需要用system dump:
alter session set events 'immediate trace name systemstate level 266';
等待幾分鐘
alter session set events 'immediate trace name systemstate level 266';
檢視trace檔案,具體呈現如下:
holding 程式: Process 33
KGX Atomic Operation Log c00000047d792a58
Mutex c000000472849030(450, 0) idn 9d25e55e oper EXCL
Cursor Pin uid 450 efd 0 whr 1 slp 0
........................................
name=update b_m_tdm_elec_xmd Set chanl_cust_no = :a0,date_id=:a1 where pro_id=:a and tlr_id=:b and date_id=:c and acct_no=:d
..............................................
Blocked 程式: process 26
waiting for 'cursor: pin S wait on X' blocking sess=0x0000000000000000 seq=32649 wait_time=0 seconds
since wait started=0 idn=9d25e55e, value=1c200000000, where|sleeps=50106dcec
KGX Atomic Operation Log c00000047d28bc08
Mutex c000000472849030(450, 0) idn 9d25e55e oper GET_SHRD
Cursor Pin uid 568 efd 0 whr 5 slp 49205
......................................
name=update b_m_tdm_elec_xmd Set chanl_cust_no = :a0,date_id=:a1 where pro_id=:a and tlr_id=:b and date_id=:c and acct_no=:d
從dump檔案可以看出, holding 程式執行update語句,獲取Mutex 為獨享模式(oper EXCL)。而blodked 程式執行相同的update語句,想獲取共享模式(oper GET_SHRD),發生等待,等待的SID=450。
懷疑可能ORACLE的bug,需要以下測試看是否該問題能消除:
1、將記憶體自動管理(AMM)關閉;
2、設定_kks_use_mutex_pin=false
P1: 遊標的hash值
P2: 頭兩個位元組表示holding Mutex SID, 後面兩個位元組通常為0
P3: Mutex where an internal code locator 或 with mutex sleeps
通過v$mutex_sleep可以看到mutex資訊
select * from v$mutex_sleep
MUTEX_TYPE LOCATION SLEEPS WAIT_TIME
-------------------------------- ---------------------------------------- ---------- ----------
Cursor Parent kksfbc [KKSPRTLOC2] 42 49
.......................................
Cursor Pin kksSetBindType [KKSCHLPIN3] 20 378277
Cursor Pin kkslce [KKSCHLPIN2] 1819288987 3378316655
從以上檢視中發現一個mutex_type cursor pin有嚴重的sleeps和等待。
select sid, p2raw from v$session where event='cursor: pin S wait on X'
發現所有的sid 的p2raw值相同,通過擷取p2raw頭兩位,轉化成十進位制,獲得holding mutext的SID,然後找出對應的程式將其kill。
在檢視holding SID與blocked SID關係的時候,需要用system dump:
alter session set events 'immediate trace name systemstate level 266';
等待幾分鐘
alter session set events 'immediate trace name systemstate level 266';
檢視trace檔案,具體呈現如下:
holding 程式: Process 33
KGX Atomic Operation Log c00000047d792a58
Mutex c000000472849030(450, 0) idn 9d25e55e oper EXCL
Cursor Pin uid 450 efd 0 whr 1 slp 0
........................................
name=update b_m_tdm_elec_xmd Set chanl_cust_no = :a0,date_id=:a1 where pro_id=:a and tlr_id=:b and date_id=:c and acct_no=:d
..............................................
Blocked 程式: process 26
waiting for 'cursor: pin S wait on X' blocking sess=0x0000000000000000 seq=32649 wait_time=0 seconds
since wait started=0 idn=9d25e55e, value=1c200000000, where|sleeps=50106dcec
KGX Atomic Operation Log c00000047d28bc08
Mutex c000000472849030(450, 0) idn 9d25e55e oper GET_SHRD
Cursor Pin uid 568 efd 0 whr 5 slp 49205
......................................
name=update b_m_tdm_elec_xmd Set chanl_cust_no = :a0,date_id=:a1 where pro_id=:a and tlr_id=:b and date_id=:c and acct_no=:d
從dump檔案可以看出, holding 程式執行update語句,獲取Mutex 為獨享模式(oper EXCL)。而blodked 程式執行相同的update語句,想獲取共享模式(oper GET_SHRD),發生等待,等待的SID=450。
懷疑可能ORACLE的bug,需要以下測試看是否該問題能消除:
1、將記憶體自動管理(AMM)關閉;
2、設定_kks_use_mutex_pin=false
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/354732/viewspace-604483/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 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 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 wait on X的處理AI
- 分散式引起的cursor: pin S wait on X 事件一次問題處理分散式AI事件
- [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
- sql version count引發cursor:pin s wait x及library cache latch library cache lockSQLAI
- 等待事件Cursor: Pin S Wait On X和Library Cache Load Locks可能意味著過度的記憶體調整事件AI記憶體
- 學習Oracle核心(cursor: pin S)Oracle
- 遭遇cursor:pin x等待事件定位阻塞會話診斷過程事件會話
- cursor: pin S模擬與處理
- [20201117]解析cursor pin S等待事件.txt事件
- 'cursor:mutex ..'/ 'cursor:pin ..'/ 'library cache:mutex ..'型別的等待事件Mutex型別事件
- cursor: mutex S等待事件Mutex事件
- cursor: pin S產生原理及解決方法
- 解析cursor pin S等待事件中的p1、p2、p3值事件
- cursor: pin S簡單說明以及測試、解決
- AWR報告分析之三:cursor: pin S 的原理與案例分析