博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle单实例情况下的library cache pin的问题模拟与问题分析
阅读量:6818 次
发布时间:2019-06-26

本文共 3964 字,大约阅读时间需要 13 分钟。

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 sysdbaSQL*Plus: Release 10.2.0.5.0 - Production on Fri Jun 12 17:27:28 2015Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.Connected to an idle instance.SQL> startupORACLE instance started.Total System Global Area  281018368 bytesFixed Size                  2095672 bytesVariable Size              96470472 bytesDatabase Buffers          176160768 bytesRedo Buffers                6291456 bytesDatabase 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/aaaaaaConnected.SQL> show userUSER is "LC0019999"SQL> select * from v$mystat where rownum<2;       SID STATISTIC#      VALUE---------- ---------- ----------       159          0          1SQL> 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/aaaaaaSQL*Plus: Release 10.2.0.5.0 - Production on Fri Jun 12 17:34:04 2015Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> select * from v$mystat where rownum<2;       SID STATISTIC#      VALUE---------- ---------- ----------       158          0          1SQL> SQL> alter procedure lc0019999.dummy compile;------------>一直hang着

 

以sys用户新开一个session

[oracle@localhost ~]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.5.0 - Production on Fri Jun 12 17:31:33 2015Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> set line 200SQL> select sid, serial#,event from v$session where event like '%library cache pin%';       SID    SERIAL# EVENT---------- ---------- ----------------------------------------------------------------       158         28 library cache pinSQL> select sid, serial#,p1raw,event from v$session where event like '%library cache pin%';       SID    SERIAL# P1RAW            EVENT---------- ---------- ---------------- --------------------------------------------------       158         28 000000006BFF19B0 library cache pinSQL> col owner for a30SQL> col object for a30SQL> 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.

 

转载于:https://www.cnblogs.com/yutingliuyl/p/6919133.html

你可能感兴趣的文章
Asp.net中GridView使用详解(引)【转】
查看>>
Objective-C语法之扩展(Extension)的使用
查看>>
ZOJ 3819 Average Score(数学 牡丹江游戏网站)
查看>>
支持向量机的优缺点
查看>>
mongodump备份数据库
查看>>
用DMA直接驱动GPIO,实现GPIO最高输出速率(转)
查看>>
[Python] 学习笔记之MySQL数据库操作
查看>>
[LeetCode] Longest Common Prefix 最长共同前缀
查看>>
linux命令行常用快捷键
查看>>
基于FPGA的图像处理(一)--System Generator介绍
查看>>
ADT + JNI实例
查看>>
Python-文件修改器
查看>>
JavaScript把客户端时间转换为北京时间
查看>>
[C++] zlatlcv: ATL字符串转换辅助库。能很方便的将UTF-8字符串转为TCHAR等字符串
查看>>
你听过的最心酸的一句话是什么?
查看>>
ios 图片处理( 1.按比例缩放 2.指定宽度按比例缩放
查看>>
nginx 直接在配置文章中设置日志分割
查看>>
(算法)二叉树中两个结点的最近公共父结点
查看>>
Android实例-监测网络状态及一些事件(XE8+小米2)
查看>>
HDU 4686 Arc of Dream(递归矩阵加速)
查看>>