library cahce pin

时间:2021-06-21 00:43:37
 library cahce pin(库高速缓存pin)等待事件与库高速缓存并发性有关,当会话尝试在库高速缓存中钉住对象

以修改或检查该对象时产生该事件。会话必须获取(pin)以确保此时对象没有被其他会话更新。

当会话正在编译或分析PL/SQL过程和视图时,Oracle提交该事件。

library cache pin和library cache lock的并不是hard parse

create or replace procedure test_prc as
begin
insert into test1 select * from test1;
end; SESSION SID=1执行该存储过程后, SESSION SID=36去编译该过程 SQL> select sid,event from v$session_wait where event not like '%message%'; SID EVENT
---------- ----------------------------------------------------------------
1 db file scattered read
2 pmon timer
3 VKTM Logical Idle Wait
5 DIAG idle wait
8 DIAG idle wait
10 db file async I/O submit
12 log file parallel write
13 smon timer
18 Streams AQ: qmn coordinator idle wait
26 Streams AQ: qmn slave idle wait
28 Space Manager: slave idle wait SID EVENT
---------- ----------------------------------------------------------------
32 Streams AQ: waiting for time management or cleanup tasks
36 library cache pin
37 Data file init write 14 rows selected. SQL> col name format a30
SQL> select SESSION_ID,NAME,P1,P2,P3,WAIT_TIME,CURRENT_OBJ#,CURRENT_FILE#,CURRENT_BLOCK#
from v$active_session_history ash, v$event_name enm
where ash.event#=enm.event#
and SESSION_ID=36; 2 3 4 SESSION_ID NAME P1 P2 P3 WAIT_TIME CURRENT_OBJ# CURRENT_FILE# CURRENT_BLOCK#
---------- ------------------------------ ---------- ---------- ---------- ---------- ------------ ------------- --------------
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139 SESSION_ID NAME P1 P2 P3 WAIT_TIME CURRENT_OBJ# CURRENT_FILE# CURRENT_BLOCK#
---------- ------------------------------ ---------- ---------- ---------- ---------- ------------ ------------- --------------
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139
36 library cache pin 737880368 737837676 65539 0 236 1 102139 SQL> SQL> select name, PARAMETER1,PARAMETER2,PARAMETER3 from v$event_name where name='library cache pin'; NAME PARAMETER1 PARAMETER2 PARAMETER3
------------------------------ -------------------- -------------------- ------------------------------
library cache pin handle address pin address 100*mode+namespace --通过查询V$SESSION_WAIT找出正在等待”library cache pin”的session
SQL> SELECT sid,
SUBSTR (event, 1, 30),
TO_CHAR(p1, 'xxxxxxxx') p1_16,
--P1RAW P1_16,
p2,
p3
FROM v$session_wait
WHERE wait_time = 0 AND event LIKE 'library cache pin%'; 2 3 4 5 6 7 8 SID SUBSTR(EVENT,1,30) P1_16 P2 P3
---------- ------------------------------------------------------------ --------- ---------- ----------
36 library cache pin 2bfb2930 737458808 3.3599E+14 --通过查询DBA_LOCK_INTERNAL和V$SESSION_WAIT,可得到与”library cache pin” 等待相关的object的名字
SQL> SELECT TO_CHAR (SESSION_ID, '999') sid,
SUBSTR (LOCK_TYPE, 1, 30) TYPE,
SUBSTR (lock_id1, 1, 23) Object_Name,
SUBSTR (mode_held, 1, 4) HELD,
SUBSTR (mode_requested, 1, 4) REQ,
lock_id2 Lock_addr
FROM dba_lock_internal
WHERE mode_requested <> 'None' AND mode_requested <> mode_held
AND session_id IN
(SELECT sid
FROM v$session_wait
WHERE wait_time = 0 AND event LIKE 'library cache pin%');
2 3 4 5 6 7 8 9 10 11 12 ; SID TYPE OBJECT_NAME HELD REQ LOCK_ADDR
---- ------------------------------------------------------------ ---------------------------------------------- -------- -------- ------------------------- ---------------
36 Table/Procedure/Type Definitio TEST.TEST_PRC None Excl 2BFB2930 SQL> SQL> select sid, P1RAW,P1TEXT ,event from v$session_wait where event not like '%message%'; SID P1RAW P1TEXT EVENT
---------- ---------------- ------------------------------ ----------------------------------------------------------------
1 0000000000000004 file# db file scattered read
2 0000000000000100 duration pmon timer
3 00 VKTM Logical Idle Wait
5 0000000000000005 component DIAG idle wait
8 0000000000000005 component DIAG idle wait
10 000000000000077A requests db file async I/O submit
12 0000000000000001 files log file parallel write
13 000000000000012C sleep time smon timer
18 00 Streams AQ: qmn coordinator idle wait
26 0000000000000001 Type Streams AQ: qmn slave idle wait
28 0000000000000001 Slave ID Space Manager: slave idle wait SID P1RAW P1TEXT EVENT
---------- ---------------- ------------------------------ ----------------------------------------------------------------
32 00 Streams AQ: waiting for time management or cleanup tasks
36 000000002BFB2930 handle address library cache pin
37 00 Slave ID Space Manager: slave idle wait 14 rows selected. SELECT s.sid, kglpnmod "Mode", kglpnreq "Req",p.kglpnhdl
FROM x$kglpn p, v$session s
WHERE p.kglpnuse=s.saddr
AND kglpnhdl='&P1RAW' SQL> SELECT s.sid, kglpnmod "Mode", kglpnreq "Req",p.kglpnhdl
FROM x$kglpn p, v$session s
WHERE p.kglpnuse=s.saddr 2 3 ; SID Mode Req KGLPNHDL
---------- ---------- ---------- --------
36 0 3 2BFB2930
1 2 0 2BFB2930 这里的kglpnhdl=p1_16 SID SUBSTR(EVENT,1,30) P1_16 P2 P3
---------- ------------------------------------------------------------ --------- ---------- ----------
36 library cache pin 2bfb2930 737458808 3.3599E+14 000000002BFB2930 16进制就是2BFB2930 转换为10进制就是737880368






														
		

library cahce pin的更多相关文章

  1. 如何使用event 10049分析定位library cache lock and library cache pin

    Oracle Library Cache 的 lock 与 pin 说明 一. 相关的基本概念 之前整理了一篇blog,讲了Library Cache 的机制,参考: Oracle Library c ...

  2. 一次library cache pin故障的解决过程

    内容如下: 今天接到同事的电话,说他的一个存储过程已经run了一个多小时了,还在继续run,他觉得极不正常,按道理说不应该run这么长时间. 我说那我去看一下吧. 这个库是一个AIX上的10.2.0. ...

  3. 深入理解shared pool共享池之library cache的library cache pin系列三

    关于library cache相关的LATCH非常多,名称差不多,我相信一些人对这些概念还是有些晕,我之前也有些晕,希望此文可以对这些概念有个更为清晰的理解,本文主要学习library cache p ...

  4. 外键约束列并没有导致大量建筑指数library cache pin&sol;library cache lock

    外键约束列并没有导致大量建筑指数library cache pin/library cache lock 清除一个100大数据表超过一百万线,发现已经运行了几个小时: delete B001.T_B1 ...

  5. Resolving Issues of &quot&semi;Library Cache Pin&quot&semi; or &quot&semi;Cursor Pin S wait on X&quot&semi; &lpar;Doc ID 1476663&period;1&rpar;

    Doc ID 1476663.1) To Bottom In this Document   Purpose   Troubleshooting Steps   Brief Definition:   ...

  6. 怎么发现RAC环境中&amp&semi;&num;39&semi;library cache pin&amp&semi;&num;39&semi;等待事件的堵塞者(Blocker)&quest;

    怎么发现RAC环境中的'library cache pin'等待事件的堵塞者(Blocker) 參考自 How to Find the Blocker of the 'library cache pi ...

  7. DBA手记(学习)-library cache pin

    select sid,event,p1raw from v$session_wait where event like 'library cache pin%'; select sql_text fr ...

  8. Oracle单实例情况下的library cache pin的问题模拟与问题分析

    Oracle单实例情况下的library cache pin的问题模拟与问题分析 參考自: WAITEVENT: "library cache pin" Reference Not ...

  9. library cache pin解决方法

    library cache pin大部分都是因为编译存储过程造成的 查找造成问题的数据库对象(一般为存储过程) SELECT * FROM v$session_wait WHERE event = ' ...

随机推荐

  1. makefile函数

    http://www.cnblogs.com/tianyajuanke/archive/2013/02/16/2610276.html 通用步骤: 编译时,可以不知钉头文件,如果指定头文件,其作用是当 ...

  2. Cocos2d-x使用iOS游戏内付费IAP&lpar;C&plus;&plus;篇&rpar;

    本文章转载 http://www.ityran.com/archives/5515.非本人原创! 前期准备 设备与账号 在开始编码之前我们需要准备测试环境. IAP只能真机测试,准备一台iOS设备是必 ...

  3. Unity 读取Excel

    游戏有大多数配置文件,比如玩家等级,游戏商店信息等等.通常情况下把这些放入excel中来读取 第一种解决方案: xlsx –> csv –> 改变成UTF-8 或者Unicode编码 –& ...

  4. 异步编程(Async和Await)的使用

    .net4.5新特性之异步编程(Async和Await)的使用 一.简介 首先来看看.net的发展中的各个阶段的特性:NET 与C# 的每个版本发布都是有一个“主题”.即:C#1.0托管代码→C#2. ...

  5. The type java&period;lang&period;Object cannot be resolved&period; It is indirectly referenced from required &period;class files

    The type java.lang.Object cannot be resolved.It is indirectly referenced from required .class files ...

  6. selenium Python 总结一些工作中可能会经常使用到的API。

    selenium Python 总结一些工作中可能会经常使用到的API. 1.获取当前页面的Url 方法:current_url 实例:driver.current_url 2.获取元素坐标 方法:l ...

  7. 进程池的回调函数callback

    如下代码: from multiprocessing import Pool def func1(n): print('in func1') return n*n def func2(nn): pri ...

  8. 记一次vcsa6修复过程

    一. 某天发现一台vmware  vCenter Server Appliance services 6偶尔能登陆了,但极不稳定,连shell都偶尔能进...... 然后利用各种手段想方设法进到she ...

  9. 在Linux下,如何分析一个程序达到性能瓶颈的原因

    0.在Linux下,如何分析一个程序达到性能瓶颈的原因,请分别从CPU.内存.IO.网络的角度判断是谁导致的瓶颈?注意现在的机器CPU是多核 1.用sar -n DEV 1 10 2.用iotop命令 ...

  10. 5 JInja2模版(适用于Django和Flask)

    模版 在生产环节下,我们要把后端程序(其实就是python)计算出来的数据和html页面结合起来做,这个时候模版就派上大用处了. Flask下的模版---Jinja2 Jinja是日本寺庙的意思,并且 ...