Solved

Wait event - Library cache lock

Posted on 2007-12-03
5
5,080 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 73

Expert Comment

by:sdstuber
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
>>  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
Comment Utility
Although problem was solved  . but your justifiaction to the problem convinces me .
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
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 videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now