[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Wait event - Library cache lock

Posted on 2007-12-03
5
Medium Priority
?
5,114 Views
Last Modified: 2013-12-19
What does wait event - library cache lock  is ? how to resolve it ?
0
Comment
Question by:amolghadge
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 74

Expert Comment

by:sdstuber
ID: 20398854
It means you're parsing too often and one session has to wait to be able to get into the library to try to parse.

This is almost always caused by a failure to use bind variables.

0
 
LVL 27

Expert Comment

by:sujith80
ID: 20401369
Use the following query to find, which session is doing the blocking. You can trace back from there what activities are causing the block.

select /*+ ordered use_nl(lob pn ses) */
decode(lob.kglobtyp, 0, 'NEXT OBJECT ', 1, 'INDEX ', 2, 'TABLE ', 3, 'CLUSTER ',
4, 'VIEW ', 5, 'SYNONYM ', 6, 'SEQUENCE ',
7, 'PROCEDURE ', 8, 'FUNCTION ', 9, 'PACKAGE ',
11, 'PACKAGE BODY ', 12, 'TRIGGER ',
13, 'TYPE ', 14, 'TYPE BODY ',
19, 'TABLE PARTITION ', 20, 'INDEX PARTITION ', 21, 'LOB ',
22, 'LIBRARY ', 23, 'DIRECTORY ', 24, 'QUEUE ',
28, 'JAVA SOURCE ', 29, 'JAVA CLASS ', 30, 'JAVA RESOURCE ',
32, 'INDEXTYPE ', 33, 'OPERATOR ',
34, 'TABLE SUBPARTITION ', 35, 'INDEX SUBPARTITION ',
40, 'LOB PARTITION ', 41, 'LOB SUBPARTITION ',
42, 'MATERIALIZED VIEW ',
43, 'DIMENSION ',
44, 'CONTEXT ', 46, 'RULE SET ', 47, 'RESOURCE PLAN ',
48, 'CONSUMER GROUP ',
51, 'SUBSCRIPTION ', 52, 'LOCATION ',
55, 'XML SCHEMA ', 56, 'JAVA DATA ',
57, 'SECURITY PROFILE ', 59, 'RULE ',
62, 'EVALUATION CONTEXT ',
'UNDEFINED ') object_type,
lob.kglnaobj object_name,
pn.kglpnmod lock_mode_held,
pn.kglpnreq lock_mode_requested,
ses.sid,
ses.serial#,
ses.username
from v$session_wait vsw,
x$kglob lob,
x$kglpn pn,
v$session ses
where vsw.event = 'library cache lock '
and vsw.p1raw = lob.kglhdadr
and lob.kglhdadr = pn.kglpnhdl
and pn.kglpnmod != 0
and pn.kglpnuse = ses.saddr
order by pn.kglpnmod desc, pn.kglpnreq desc
/

There are several reasons for this wait event, generally you may try the following.
-- increase the shared pool size
-- avoid running too many jobs in parallel, sequence your jobs
-- schedule activities like MV refreshes to off peak hours
-- upgrade to latest versions of oracle
--
0
 
LVL 1

Author Comment

by:amolghadge
ID: 20403070
Ststuber: Thanks . But  I had only one session to the database . It was meant for dropping all the synonyms .
Sujith80 : I had tried to find out the blocking sessions also . but nothing could be found as blocking .

Problem was resolved after the bounce of the database . I am still not clear about the cause .
0
 
LVL 27

Accepted Solution

by:
sujith80 earned 1500 total points
ID: 20408976
>>  I had only one session to the database
You mean to say no other session was there at that moment?

>> It was meant for dropping all the synonyms
Frequent changes to object definitions will cause latches on the library cache as it has to re-load the changed definitions. That could be the reason.
See this link:
http://www.ixora.com.au/q+a/0101/19235723.htm
0
 
LVL 1

Author Closing Comment

by:amolghadge
ID: 31412439
Although problem was solved  . but your justifiaction to the problem convinces me .
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question