怎么发现RAC环境中'library cache pin'等待事件的堵塞者(Blocker)?
怎么发现RAC环境中的'library cache pin'等待事件的堵塞者(Blocker)
參考自
How to Find the Blocker of the 'library cache pin' in a RAC environment? (文档 ID 780514.1)
本文不做翻译。全文转载:
Applies to:
Oracle Database - Enterprise Edition - Version 9.2.0.1 to 11.1.0.7 [Release 9.2 to 11.1]
Information in this document applies to any platform.
Add ***Checked for relevance on 15-Dec-2010***
Goal
The goal of this note is to explain how to understand who is blocking a 'library cache pin' in a RAC environment
Fix
a. introduction
V$SESSION blocking fields can't be used for library cache locks/pins.
Note:169139.1 explains how to diagnose library cache locks/pin in single instance systems. The pin/lock handles
are however different on each database instance. So, the pin/lock handle of the DBA_KGLLOCK can't be used with a RAC database and view DBA_KGLLOCK can just be used to locate waiting sessions.
Note:34579.1 can then be used to locate the object locked (via the x$kglob query) on some other instances.
Once you have the object locked, you can query each instance and drill down the opposite way
to know who is holding a pin on that object via instance views X$KGLOB to get the local instance KGLHDADR => then v$session/DBA_KGLLOCK.
2. scenario example
Scenario to simulate a 'library cache pin' problem
a. Session 1 on instance1: Create a dummy procedure:
Create or replace procedure dummy is
begin
null;
end;
/
b. Session 1 on instance1: Execute the above procedure in a PL/SQL block to block the dummy
Begin
Dummy;
Dbms_lock.sleep(1000);
End;
/
3. Session 2 on instance2: Compile the the above procedure.
alter procedure dummy compile; => session 2 will be blocked in 'library cache pin'.
3. How to find the blocker
a. find the p1raw value of the 'library cache pin', e.g.
select sid, event, p1raw from v$session_wait where event = 'library cache pin';
SID EVENT P1RAW
--- ----------------- --------
150 library cache pin 288822D4
select * from dba_kgllock where kgllkreq > 0;
KGLLKUSE KGLLKHDL KGLLKMOD KGLLKREQ KGLL
-------- -------- -------- -------- ----
2CB1F978 288822D4 0 3 Pin
2. find the locked object via x$kglob, e.g.
select kglnaown, kglnaobj from x$kglob where kglhdadr = '288822D4';
KGLNAOWN KGLNAOBJ
-------- --------
SYS DUMMY
3. find the kglhdadr in the other instances, e.g.--->这是在其它的实例上运行。
select kglhdadr, kglnaown, kglnaobj from x$kglob where kglnaobj = 'DUMMY';
KGLHDADR KGLNAOWN KGLNAOBJ
-------- -------- --------
28577AD8 SYS DUMMY
4. find the blocking session on the remote instance, e.g.--->这是在其它的实例上运行。
select sid, serial#, sql_text from dba_kgllock w, v$session s, v$sqlarea a
where w.kgllkuse = s.saddr and w.kgllkhdl='28577AD8'
and s.sql_address = a.address
and s.sql_hash_value = a.hash_value;
SID SERIAL# SQL_TEXT
--- ------- ---------------------------------------
155 939 begin dummy; dbms_lock.sleep(1000); end;
怎么发现RAC环境中'library cache pin'等待事件的堵塞者(Blocker)?的更多相关文章
- 一次library cache pin故障的解决过程
内容如下: 今天接到同事的电话,说他的一个存储过程已经run了一个多小时了,还在继续run,他觉得极不正常,按道理说不应该run这么长时间. 我说那我去看一下吧. 这个库是一个AIX上的10.2.0. ...
- 如何使用event 10049分析定位library cache lock and library cache pin
Oracle Library Cache 的 lock 与 pin 说明 一. 相关的基本概念 之前整理了一篇blog,讲了Library Cache 的机制,参考: Oracle Library c ...
- DBA手记(学习)-library cache pin
select sid,event,p1raw from v$session_wait where event like 'library cache pin%'; select sql_text fr ...
- 【翻译自mos文章】在11gR2 rac环境中,文件系统使用率紧张,而且lsof显示有非常多oraagent_oracle.l10 (deleted)
在11gR2 rac环境中,文件系统使用率紧张.而且lsof显示有非常多oraagent_oracle.l10 (deleted) 參考原文: High Space Usage and "l ...
- 外键约束列并没有导致大量建筑指数library cache pin/library cache lock
外键约束列并没有导致大量建筑指数library cache pin/library cache lock 清除一个100大数据表超过一百万线,发现已经运行了几个小时: delete B001.T_B1 ...
- Oracle单实例情况下的library cache pin的问题模拟与问题分析
Oracle单实例情况下的library cache pin的问题模拟与问题分析 參考自: WAITEVENT: "library cache pin" Reference Not ...
- library cache pin解决方法
library cache pin大部分都是因为编译存储过程造成的 查找造成问题的数据库对象(一般为存储过程) SELECT * FROM v$session_wait WHERE event = ' ...
- 深入理解shared pool共享池之library cache的library cache pin系列三
关于library cache相关的LATCH非常多,名称差不多,我相信一些人对这些概念还是有些晕,我之前也有些晕,希望此文可以对这些概念有个更为清晰的理解,本文主要学习library cache p ...
- Resolving Issues of "Library Cache Pin" or "Cursor Pin S wait on X" (Doc ID 1476663.1)
Doc ID 1476663.1) To Bottom In this Document Purpose Troubleshooting Steps Brief Definition: ...
随机推荐
- Maven从私服上下载所需jar包——(十四)
1.修改settings.xml 将下面代码添加到settings.xml中 <profile> <!--profile的id--> <id>dev</id& ...
- Kth Smallest Number in Sorted Matrix
Find the kth smallest number in at row and column sorted matrix. Example Given k = 4 and a matrix: [ ...
- Windows修改默认远程端口号3389
1.打开注册表:运行-regedit: 2.HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\Wds\Repwd\ ...
- find查找时排除目录及文件
查找根目录下大于500M的文件,排除/proc目录 find / ! -path "/proc/*" -type f -size +500M | sort -rh|xargs ls ...
- CentOS 5.x 键盘布局改为日语
CentOS 5.x 直接在系统设置界面修改键盘布局,可能不起作用,需要按如下步骤修改配置文件. 1. /etc/sysconfig/keyboard KEYTABLE="jp106&quo ...
- OS X 10.11:在exFAT分区的外置硬盘上使用Time Machine。
Time Machine默认需要使用HFS+分区的外置硬盘,但在网络硬盘上也可以使用单个的 .sparsebundle 镜像文件备份.在本地USB或Firewire等接口连接的外置硬盘,只有exFAT ...
- 【TensorFlow】获取object detection API训练模型的输出坐标
如下图,谷歌开源的object detection API提供了五种网络结构的fine-tuning训练权重,方便我们针对目标检测的需求进行模型训练,本文详细介绍下导出训练模型后,如何获得目标检测框的 ...
- scanf 输入加逗号(或者不加逗号)出现的异常及解决方案
我们在写 C 语言代码通常 scanf 的格式控制部分都有两种习惯,加逗号与不加逗号,而这两种情况都会因为我们的不同输入习惯产生一定的问题,这里给出另一种方法. 1.不加逗号 #include< ...
- .NetCore下B/S结构 初探基于遗传学算法的中学自动排课走班(二)
分析下染色体基因 这里用 老师 课程 班级 教室 周天 上下晚 课时作为染色体编码我封装了如下类 /// <summary> /// NP 授课事件 由教室.课程.班级 时间片段构成 li ...
- Centos7 服务器启动jar包
首先Centos7 推荐我们这么运行项目 首先执行命令: cd /ets/systemd/system到这个目录下,新建一个 yourProjectName.service,可以把yourProjec ...