My colleague suddenly encountered a problem today,a Database becomes very slow , and the a lot of session wait library cache lock event, Let me help him to look. DB env is 10.2.0.4 rac. at first ,to generate a AWR manually. exec dbms_workload_reposit…
rac数据库默认sql tuning advisor,导致大量library cache lock 问题现象:客户反映周六周日固定十点钟,一个程序会特别慢(大概10分钟),平时1到2秒.查看当时的日志发现:DBMS_STATS: GATHER_STATS_JOB encountered errors.  Check the trace file.Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl1/trace/orcl1_j002_51847.…
1.现象: 客户10.2.0.4 RAC环境,出现大量的library cache lock和cursor: pin S wait on X等待,经分析是由于统计信息收集僵死导致的.数据库在8点到9点期间,数据库两个节点都存在明显的cursor: pin S wait on X和library cache lock的等待: TOP 5 EVENT: Event Waits Time(s) Avg   Wait(ms) %   Total Call Time Wait   Class cursor…
Library cache lock/pin 一.概述 ---本文是网络资料加metalink 等整理得来一个实例中的library cache包括了不同类型对象的描述,如:游标,索引,表,视图,过程,等等. 这些对象不能在他们被使用的时候改变,他们在被使用的时候会被一种library locks and pins的机制锁住. 一个会话中,需要使用一个对象,会在该对象上先得到一个library lock(null, shared or exclusive模式的)这是为了,防止其他会话也访问这个对…
本文了解下等待事件library cache lock,进一步理解library cache,之前的文章请见:  深入理解shared pool共享池之library cache的library cache pin系列三 相关图例 为了真观理解library cache pin及library cache lock的联系,有个图: 结论 1,道理同library cache pin一样,诊断library cache lock也要使用v$session及dba_kgllock2, library…
Oracle Library Cache 的 lock 与 pin 说明 一. 相关的基本概念 之前整理了一篇blog,讲了Library Cache 的机制,参考: Oracle Library cache 内部机制 说明 http://blog.csdn.net/tianlesoftware/article/details/6629869 在这个机制中,没有详细讲library 上的lock 和pin.这2个概念对DB 的理解非常重要. 所以单独拿出来,进行说明. 根据hellodba 和…
SESSION 34 执行存储过程: SESSION 43 编译存储过程: SESSION 25 删除存储过程: 1.查询查看library cache lock等待事件的相关会话 SQL> select sid, P1RAW,P1TEXT ,event from v$session_wait where event not like '%message%'; SID P1RAW P1TEXT EVENT ---------- ---------------- -----------------…
What is "Library cache lock" ? This event controls the concurrency between clients of the library cache. It acquires a lock on the object handle so that either: One client can prevent other clients from accessing the same object. The client can…
今天收到同事电话,说是数据库中一张名为acct_balance进行操作是奇慢,第一反映是不是扫行计划有问题,结果我错了,现将过程记录下来. 用pl/sql连上数据库情况:1.对acct_balance表的查询很慢,正常少于0.1s完成,现在要60s完成:2.使用explain plan对语句进行分析,过析比正常情况下慢很多. 下面为处理过程:1.从v$session_wait中查找有问题的waitSql>select event,count(*) from v$session_wait grou…
外键约束列并没有导致大量建筑指数library cache pin/library cache lock 清除一个100大数据表超过一百万线,发现已经运行了几个小时: delete B001.T_B11; 由下面的SQL跟踪,发现经常发生library cache pin和library cache lock的等待,怀疑有大量的recursive sql在运行.于是对这个session做了10046: 发现有大量的例如以下SQL运行,每删除1行T_B11,都会运行以下2条SQL一次, PARSI…