DBA手记(学习)-library cache pin
程序员文章站
2022-04-06 17:57:54
select sid,event,p1raw from v$session_wait where event like 'library cache pin%';select sql_text from v$sqlarea where hash_value=(select sql_hash_valu ......
select sid,event,p1raw from v$session_wait where event like 'library cache pin%';
select sql_text from v$sqlarea where hash_value=(select sql_hash_value from v$session where sid=164);
通过以下SQL可以从 x$kglob得到正在pin的对象:
select kglnaown,kglnaobj,kglnadlk from x$kglob where kglhdadr=' 1BD820A8';
找到持有library cache pin以及等待library cache pin的session,看看mode=2的会话在干什么(2=share 3=exclusive)
select s.sid, kglpnmod "Mode", kglpnreq "Req", SPID "OS Process"
from v$session_wait w,x$kglpn p, v$session s, v$process o
where p.kglpnuse=s.saddr
and kglpnhdl=w.p1raw
and w.event like '%library cache pin%'
and s.paddr=o.addr;
上一篇: MySQL 基本语法