怎么发现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: ...
随机推荐
- AC自动机(病毒侵袭 )
题目链接:https://cn.vjudge.net/contest/280743#problem/B 题目大意:中文题目 具体思路:AC自动机模板题,编号的时候注意,是按照给定的id进行编号的.然后 ...
- Java基本数据类型装箱的127临界点
package wrapper.demo; public class WrapperDemo { /** * @param args */ public static void main(String ...
- 多继承下的super()指向的不一定是直接父类
常规情况 class Base: def __init__(self): print('Base.__init__') class A(Base): def __init__(self): super ...
- google closure 笔记-SOY template
一 使用js模板 closure template 目前支持Java和js.但是模板语法的设计不依赖于任何现成的语言,所以理论上可以支持任何语言,只是暂时只有java编译器. 使用js模板:编写模板文 ...
- mybatis SQL构造器
org.apache.ibatis.jdbc.AbstractSQL<T> org.apache.ibatis.jdbc.AbstractSQL<T> 抽象泛型类,它主要用于解 ...
- BCTF2017 BabyUse
BCTF2017 BabyUse 问题 问题在于drop函数中在释放块之后没有清空bss_gun_list中的指针. 一般因为存在对bss_gun_flag的验证,所以不会出现什么问题,但是在use功 ...
- Java编程的逻辑 (67) - 线程的基本协作机制 (上)
本系列文章经补充和完善,已修订整理成书<Java编程的逻辑>,由机械工业出版社华章分社出版,于2018年1月上市热销,读者好评如潮!各大网店和书店有售,欢迎购买,京东自营链接:http: ...
- [java] DOS编译 .java 文件得到 .class 文件 并执行 以及使用外部 .jar包 时的命令
当写一个java文件后,在DOS中进行编译与执行时,如果没有引入外来的包,那情况很简单 例如: public class hello_world { public static void main(S ...
- Django admin 产生'WSGIRequest' object has no attribute 'user'的错误
Django admin 产生'WSGIRequest' object has no attribute 'user'的错误 django 版本1.8.升级到django2.0, Django服务 ...
- 点击图片查看大图(纯js)
$(function(){ $(".pimg").click(function(){ var _this = $(this);//将当前的pimg元素作为_this传入函数 img ...