Solved

Wait event - Library cache lock

Posted on 2007-12-03
5
5,093 Views
Last Modified: 2013-12-19
What does wait event - library cache lock  is ? how to resolve it ?
0
Comment
Question by:amolghadge
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
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 how to recover a database from a user managed backup

790 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