欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

DBA手记(学习)-library cache pin

程序员文章站 2022-06-24 16:02:14
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;