Skip to Main Content
  • Questions
  • performance tuning - library cache pin and library cache lock

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Krishnaprasad.

Asked: July 05, 2017 - 4:07 am UTC

Last updated: October 12, 2018 - 3:19 am UTC

Version: 12c

Viewed 10K+ times! This question is

You Asked

Hi ,

i want to know about wait events of library cache pin and library cache lock

in my environment i have faced this issue but i am not able to get session whos is waiting for library cache pin and session which is acessing that object .

Request to guide me on this , additionally any script which can help me out for finding out problematic session ?

and Connor said...

Rating

  (3 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

A reader, July 06, 2017 - 9:48 am UTC

Hi,

Using X$ views are safer to execute in production environment and also on version 12c ??

A reader, July 06, 2017 - 9:49 am UTC

Hi,

Using X$ views are safer to execute in production environment and also on version 12c ??
Connor McDonald
July 07, 2017 - 2:17 am UTC

Any access to the X$ views in *any* evironment should be done with caution.

krishna, October 12, 2018 - 12:03 am UTC

Hi Connor ,

I have understand how library cache lock works but their are some scenarios where finding cause of occuring becomes difficult .

can you sahre some light how to trouble shoot how to find cause when their is no blocking session and mostly query waiting on this event are of select ,where no procedure is involved
Connor McDonald
October 12, 2018 - 3:19 am UTC

library cache locks normally indicate a higher level root cause issue. The most common I see are:

- High frequency SQL not using bind variables
- Shared pool too small (less common nowadays)
- Excessive DDL (people dropping/creating objects like they would in other database platforms)

So they are the things I look for (and tackle) when I see library cache issues in my database.

There are various means to find the session details involved. MOS Note 122793.1 covers them nicely.