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

參考自:

WAITEVENT: "library cache pin" Reference Note (文档 ID 34579.1)

How to Find the Blocker of the 'library cache pin' in a RAC environment? (文档 ID 780514.1)

本机环境:Oracle 10.2.0.5 x86-64bit for RHEL5.8 x86-64bit

第一个session:

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Jun 12 17:27:28 2015

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area  281018368 bytes
Fixed Size 2095672 bytes
Variable Size 96470472 bytes
Database Buffers 176160768 bytes
Redo Buffers 6291456 bytes
Database mounted.
Database opened. SQL> create user lc0019999 identified by aaaaaa; User created. SQL> grant dba to lc0019999; Grant succeeded. SQL> create user lc0029999 identified by aaaaaa; User created. SQL> grant dba to lc0029999; Grant succeeded. SQL> create user lc0039999 identified by aaaaaa; User created. SQL> grant dba to lc0039999; Grant succeeded. SQL> conn lc0019999/aaaaaa
Connected.
SQL> show user
USER is "LC0019999" SQL> select * from v$mystat where rownum<2; SID STATISTIC# VALUE
---------- ---------- ----------
159 0 1 SQL> Create or replace procedure dummy is
2 begin
3 null;
4 end;
5 / Procedure created. SQL> Begin
2 Dummy;
3 Dbms_lock.sleep(1000);
4 End;
5 /
------------>一直sleep着

以lc0029999登陆新开的一个session

[oracle@localhost ~]$ sqlplus lc0029999/aaaaaa

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Jun 12 17:34:04 2015

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select * from v$mystat where rownum<2; SID STATISTIC# VALUE
---------- ---------- ----------
158 0 1 SQL>
SQL> alter procedure lc0019999.dummy compile; ------------>一直hang着

以sys用户新开一个session

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Jun 12 17:31:33 2015

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> set line 200
SQL> select sid, serial#,event from v$session where event like '%library cache pin%'; SID SERIAL# EVENT
---------- ---------- ----------------------------------------------------------------
158 28 library cache pin SQL> select sid, serial#,p1raw,event from v$session where event like '%library cache pin%'; SID SERIAL# P1RAW EVENT
---------- ---------- ---------------- --------------------------------------------------
158 28 000000006BFF19B0 library cache pin SQL> col owner for a30
SQL> col object for a30
SQL> SELECT kglnaown "Owner", kglnaobj "Object"
2 FROM x$kglob
3 WHERE kglhdadr='000000006BFF19B0'---->上面查出的P1RAW值。 4 ; ---->该语句是查询出这个等待事件发生在哪个object上。 Owner Object
------------------------------ ------------------------------
LC0019999 DUMMY SQL>
SQL> SELECT s.sid, kglpnmod "Mode", kglpnreq "Req"
2 FROM x$kglpn p, v$session s
3 WHERE p.kglpnuse=s.saddr
4 AND kglpnhdl='000000006BFF19B0';---->该语句是查询出这个等待事件的等待者sid(REQ>0)和持有者sid(Mode>0) SID Mode Req
---------- ---------- ----------
158 0 3
159 2 0 SQL>
---补充:例如以下文字来源于:
<blockquote><strong><code>Mode</code></strong><span> </span>is the mode in which the pin is wanted. This is a number thus:<ul><li>2 - Share mode</li><li>3 - Exclusive mode</li></ul></blockquote>
 
例如以下摘自:WAITEVENT: "library cache pin" Reference Note (文档 ID 34579.1)
An X request (3) will be blocked by any pins held S mode (2) on the object.
An S request (2) will be blocked by any X mode (3) pin held, or may queue behind some other X request.

Oracle单实例情况下的library cache pin的问题模拟与问题分析的更多相关文章

  1. Oracle内存详解之二 Library cache 库缓冲-转载

    Library cache是Shared pool的一部分,它几乎是Oracle内存结构中最复杂的一部分,主要存放shared curosr(SQL)和PLSQL对象(function,procedu ...

  2. oracle 单实例DG(搭建篇一)

    一,介绍 lodding... 二,安装前环境配置 01,依赖包的安装: yum install binutils-* yum install compat-libstdc++-* yum insta ...

  3. Oracle 单实例数据库安装和real application clusters数据库安装的区别

    在想了解Oracle单实例数据可和RAC数据库前,请确保你已经知道了数据库和实例的关系,如果不了解,请参考Oracle 数据库实例和数据库. 单实例数据库模式 单实例模式下,一个数据库只能通过一个实例 ...

  4. Oracle Study之--Oracle 单实例11.2.0.1.0升级到11.2.0.3.0

    Oracle Study之--Oracle 单实例11.2.0.1.0升级到11.2.0.3.0 系统环境: 操作系统:RedHat EL6(64位) Oracle:    Oracle 11gR2 ...

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

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

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

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

  7. 外键约束列并没有导致大量建筑指数library cache pin/library cache lock

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

  8. 怎么发现RAC环境中&#39;library cache pin&#39;等待事件的堵塞者(Blocker)?

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

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

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

随机推荐

  1. javaScript将string转换成array,并将汉字按汉语拼音排序方法

    亲测,代码如下: var str = '中华人民共和国民主富强': var arr = str.split("");//字符串装换数组方法一 //arr = str.replace ...

  2. HDU 2155 Matrix

    Matrix Time Limit: 3000ms Memory Limit: 65536KB This problem will be judged on PKU. Original ID: 215 ...

  3. PatentTips - Object-oriented processor architecture and operating method

    BACKGROUND OF THE INVENTION The present invention relates to processors and computer systems. More s ...

  4. Qt之设置应用程序图标

    简述 应用程序图标,通常显示在应用程序的顶层窗口的左上角,通过调用QWindow:setWindowIcon()函数来实现. 为了改变可执行程序文件本身的图标,因为它被呈现在桌面上,它必须采用另一种依 ...

  5. [CSS3] CSS Background Images

    Body with background image and gradient html { background: linear-gradient(#000, white) no-repeat; h ...

  6. 主站sinox.org堵塞太厉害,大家用sinox.3322.org訪问

    近期 www.sinox.org域名堵塞太厉害了.差点儿不能訪问,如今大家用sinox.3322.org訪问 sinox.org仅仅是显示正在建设 一直以来sinox.org仅仅是个摆设,并非主要域名 ...

  7. ORA 12505 Listener does not currently know of SID given in connection descriptor

    oracle数据库正常启动后.在本地能够正常訪问,可是远程使用sqldevelop却不能訪问.提示ORA 12505 Listener does not currently know of SID g ...

  8. Composer使用实践

    Composer 是 PHP5.3以上 的一个依赖管理工具.它允许你声明项目所依赖的代码库,它会在你的项目中为你安装他们. 地址在这里 库地址 这里相当于php应用商店,存放着很多库. 这些库,基本上 ...

  9. angular4(2-1)angular脚手架引入第三方类库(jquery)

    欢迎加入前端交流群交流知识&&获取视频资料:749539640 如何在angular4脚手架中引入第三方类库呢比如jquery.swiper.bootstrap...... 例如引入j ...

  10. [luogu P2123] 皇后游戏 解题报告(贪心)

    题目链接:https://www.luogu.org/problemnew/show/P2123 题目大意: 给定a数组和b数组,要求最小化c数组中的最大值 题解: 考虑微扰法,推一波式子先 设$x= ...