Solved

Wait event - Library cache lock

Posted on 2007-12-03
5
5,107 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 500 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

687 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