cursor: pin S wait on X模擬
cursor: pin S wait on X模擬
因為系統出現事件cursor: pin S wait on X過去幾天,在v$session_wait找不到對應的記錄,現需要找到引起問題的sid,從其他途徑獲得了對應的p2,故驗證p2與p2raw的轉換
現模擬出事件cursor: pin S wait on X,然後通過p2轉換出p2raw是否正確。
--==============
session 1:
--============================
SQL> select sid from v$mystat where rownum=1;
SID
----------
1147
--建立測試表
SQL> create table t tablespace users as select * from dba_objects;
表已建立。
SQL> declare
v_string varchar2(100) := 'alter system flush shared_pool';
msql varchar2(200);
begin
loop
execute immediate v_string;
for i in 1 .. 100 loop
msql:='select object_id from t where object_id='||i;
execute immediate msql;
end loop;
end loop;
end;
/
--==============================
session 2:
SQL> select sid from v$mystat where rownum=1;
SID
----------
10
SQL> declare
v_string varchar2(100) := 'alter system flush shared_pool';
msql varchar2(200);
begin
loop
execute immediate v_string;
for i in 1 .. 100 loop
msql:='select object_id from t where object_id='||i;
execute immediate msql;
end loop;
end loop;
end;
/
--================================
session 3:(監控)
SQL> select b.*, sq.sql_text
from v$session se , v$sql sq ,
(select a.*,s.sql_text from v$sql s ,
(select sid,event,wait_class,p1,p2,p2raw from v$session_wait where event like 'cursor%') a
where s.HASH_VALUE=a.p1) b
where se.sid=b.sid and se.sql_hash_value=sq.hash_value;
SID EVENT WAIT_CLASS P1 P2 P2RAW
---------- ------------------------- --------------- ---------- ---------- ----------------
SQL_TEXT
-------------------------------------------------------------------------------------------
SQL_TEXT
-------------------------------------------------------------------------------------------
1147 cursor: pin S wait on X Concurrency 3363839347 655360 00000000000A0000
select object_id from t where object_id=72
select object_id from t where object_id=72
p2:655360
p2raw:A0000
SQL> select to_char(655360,'xxxxxxxxxxxxxxx') from dual;
TO_CHAR(655360,'
----------------
a0000
可見轉換正確。
查詢對應的sid:
SQL> select to_number(substr('00000000000A0000',1,12),'xxxxxxxxxxxxxxxxxx') sid from dual;
SID
----------
10
正好對應session2.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24996904/viewspace-772651/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 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
- 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
- [20180301]模擬cursor pin S wait on X.txtAI
- oracle等待事件之cursor:pin S wait on XOracle事件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
- 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
- 分散式引起的cursor: pin S wait on X 事件一次問題處理分散式AI事件
- 解決RAC節點因cursor: pin S wait on X無法登陸案例一則AI
- cursor: pin S 等待事件事件
- sql version count引發cursor:pin s wait x及library cache latch library cache lockSQLAI
- 學習Oracle核心(cursor: pin S)Oracle
- 等待事件Cursor: Pin S Wait On X和Library Cache Load Locks可能意味著過度的記憶體調整事件AI記憶體
- cursor: pin S產生原理及解決方法
- cursor: pin S簡單說明以及測試、解決
- 等待模擬-BUFFER BUSY WAITAI
- AWR報告分析之三:cursor: pin S 的原理與案例分析
- library cache pin等待事件的模擬事件
- 遭遇cursor:pin x等待事件定位阻塞會話診斷過程事件會話
- AWR報告分析之三:cursor: pin S 的原理與案例分析-eygle
- [賽記] csp-s模擬8 && csp-s模擬9