Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
Library Cache Lock

Library Cache Lock

2004-06-02       - By David Sharples

Reply:     <<     11     12     13     14     15     16     17     18     19     20     >>  

Thanks very much - all I need to do now is go get sys access from the
dba, all I have is dba rights at present



Dave



__ ____ ____ ____ ____ ____ ____

From: oracle-l-bounce@(protected)
[mailto:oracle-l-bounce@(protected)] On Behalf Of Bobak, Mark
Sent: 02 June 2004 14:58
To: oracle-l@(protected)
Subject: RE: library cache lock



David,



Try the following query to find the blocked sessions and which session
is the blocker.

Note that due to the order by, the first session should be the blocker.



-Mark



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
/

   -- --Original Message-- --
   From: oracle-l-bounce@(protected)
[mailto:oracle-l-bounce@(protected)]On Behalf Of David Sharples
   Sent: Wednesday, June 02, 2004 9:40 AM
   To: oracle-l@(protected)
   Subject: RE: library cache lock

   I searched (probably on wrong words) didn 't return anything
useful as I could see, can you show me a url?

   

   
__ ____ ____ ____ ____ ____ ____


   From: oracle-l-bounce@(protected)
[mailto:oracle-l-bounce@(protected)] On Behalf Of Khedr, Waleed
   Sent: 02 June 2004 14:10
   To: oracle-l@(protected)
   Subject: RE: library cache lock

   

   The metalink has answers for similar issues.

   

      -- --Original Message-- --
      From: David Sharples
[mailto:dsharples@(protected)]
      Sent: Wednesday, June 02, 2004 8:44 AM
      To: oracle-l@(protected)
      Subject: library cache lock

      Hi, got a strange problem. I am trying to truncate a
partition in a table, but it just hangs forever, it is waiting on a
library cache lock. Anyone know why and how I can clear it - flushing
the shared pool didn 't help and there are no other sessions touching
that table.

      Thanks

      Dave


<html xmlns:v= "urn:schemas-microsoft-com:vml " xmlns:o= "urn:schemas-microsoft-com:office:office " xmlns:w= "urn:schemas-microsoft-com:office:word " xmlns= "http://www.w3.org/TR/REC-html40 " >

<head >
<META HTTP-EQUIV= "Content-Type " CONTENT= "text/html; charset=us-ascii " >
<meta name=Generator content= "Microsoft Word 11 (filtered medium) " >
<!--[if !mso] >
<style >
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style >
<![endif]-- >
<title >library cache lock </title >
<style >
<!--
/* Font Definitions */
@(protected)
   {font-family:Tahoma;
   panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
   {margin:0cm;
   margin-bottom:.0001pt;
   font-size:12.0pt;
   font-family: "Times New Roman ";}
a:link, span.MsoHyperlink
   {color:blue;
   text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
   {color:purple;
   text-decoration:underline;}
p
   {mso-margin-top-alt:auto;
   margin-right:0cm;
   mso-margin-bottom-alt:auto;
   margin-left:0cm;
   font-size:12.0pt;
   font-family: "Times New Roman ";}
span.EmailStyle18
   {mso-style-type:personal;
   font-family:Arial;
   color:navy;}
span.EmailStyle19
   {mso-style-type:personal-reply;
   font-family:Arial;
   color:navy;}
@(protected) Section1
   {size:612.0pt 792.0pt;
   margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
   {page:Section1;}
-- >
</style >

</head >

<body lang=EN-US link=blue vlink=purple >

<div class=Section1 >

<p class=MsoNormal > <font size=2 color=navy face=Arial > <span style= 'font-size:
10.0pt;font-family:Arial;color:navy ' >Thanks very much – all I need to do
now is go get sys access from the dba, all I have is dba rights at present <o:p > </o:p > </span > </font > </p >

<p class=MsoNormal > <font size=2 color=navy face=Arial > <span style= 'font-size:
10.0pt;font-family:Arial;color:navy ' > <o:p >  </o:p > </span > </font > </p >

<p class=MsoNormal > <font size=2 color=navy face=Arial > <span style= 'font-size:
10.0pt;font-family:Arial;color:navy ' >Dave <o:p > </o:p > </span > </font > </p >

<p class=MsoNormal > <font size=2 color=navy face=Arial > <span style= 'font-size:
10.0pt;font-family:Arial;color:navy ' > <o:p >  </o:p > </span > </font > </p >

<div >

<div class=MsoNormal align=center style= 'text-align:center ' > <font size=3
face= "Times New Roman " > <span style= 'font-size:12.0pt ' >

<hr size=2 width= "100% " align=center tabindex=-1 >

</span > </font > </div >

<p class=MsoNormal > <b > <font size=2 face=Tahoma > <span style= 'font-size:10.0pt;
font-family:Tahoma;font-weight:bold ' >From: </span > </font > </b > <font size=2
face=Tahoma > <span style= 'font-size:10.0pt;font-family:Tahoma ' > oracle-l-bounce@(protected)
[mailto:oracle-l-bounce@(protected)] <b > <span style= 'font-weight:bold ' >On
Behalf Of </span > </b >Bobak, Mark <br >
<b > <span style= 'font-weight:bold ' >Sent: </span > </b > 02 June 2004 14:58 <br >
<b > <span style= 'font-weight:bold ' >To: </span > </b > oracle-l@(protected) <br >
<b > <span style= 'font-weight:bold ' >Subject: </span > </b > RE: library cache lock </span > </font > <o:p > </o:p > </p >

</div >

<p class=MsoNormal > <font size=3 face= "Times New Roman " > <span style= 'font-size:
12.0pt ' > <o:p >  </o:p > </span > </font > </p >

<div >

<p class=MsoNormal > <font size=2 color=blue face=Arial > <span style= 'font-size:
10.0pt;font-family:Arial;color:blue ' >David, </span > </font > <o:p > </o:p > </p >

</div >

<div >

<p class=MsoNormal > <font size=3 face= "Times New Roman " > <span style= 'font-size:
12.0pt ' >  <o:p > </o:p > </span > </font > </p >

</div >

<div >

<p class=MsoNormal > <font size=2 color=blue face=Arial > <span style= 'font-size:
10.0pt;font-family:Arial;color:blue ' >Try the following query to find the
blocked sessions and which session is the blocker. </span > </font > <o:p > </o:p > </p >

</div >

<div >

<p class=MsoNormal > <font size=2 color=blue face=Arial > <span style= 'font-size:
10.0pt;font-family:Arial;color:blue ' >Note that due to the order by, the first
session should be the blocker. </span > </font > <o:p > </o:p > </p >

</div >

<div >

<p class=MsoNormal > <font size=3 face= "Times New Roman " > <span style= 'font-size:
12.0pt ' >  <o:p > </o:p > </span > </font > </p >

</div >

<div >

<p class=MsoNormal > <font size=2 color=blue face=Arial > <span style= 'font-size:
10.0pt;font-family:Arial;color:blue ' >-Mark </span > </font > <o:p > </o:p > </p >

</div >

<div >

<p class=MsoNormal > <font size=3 face= "Times New Roman " > <span style= 'font-size:
12.0pt ' >  <o:p > </o:p > </span > </font > </p >

</div >

<div >

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

</div >

<div >

<p class=MsoNormal > <font size=2 color=blue face=Arial > <span style= 'font-size:
10.0pt;font-family:Arial;color:blue ' >order by pn.kglpnmod desc, pn.kglpnreq
desc <br >
/ </span > </font > <o:p > </o:p > </p >

</div >

<blockquote style= 'margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt ' >

<p class=MsoNormal style= 'margin-bottom:12.0pt ' > <font size=2 face=Tahoma > <span
style= 'font-size:10.0pt;font-family:Tahoma ' >-- --Original Message-- -- <br >
<b > <span style= 'font-weight:bold ' >From: </span > </b >
oracle-l-bounce@(protected) [mailto:oracle-l-bounce@(protected)] <b > <span
style= 'font-weight:bold ' >On Behalf Of </span > </b >David Sharples <br >
<b > <span style= 'font-weight:bold ' >Sent: </span > </b > Wednesday, June 02, 2004
9:40 AM <br >
<b > <span style= 'font-weight:bold ' >To: </span > </b > oracle-l@(protected) <br >
<b > <span style= 'font-weight:bold ' >Subject: </span > </b > RE: library cache lock </span > </font > <o:p > </o:p > </p >

<p class=MsoNormal > <font size=2 color=navy face=Arial > <span style= 'font-size:
10.0pt;font-family:Arial;color:navy ' >I searched (probably on wrong words)
didn’t return anything useful as I could see, can you show me a url? <o:p > </o:p > </span > </font > </p >

<p class=MsoNormal > <font size=2 color=navy face=Arial > <span style= 'font-size:
10.0pt;font-family:Arial;color:navy ' > <o:p >  </o:p > </span > </font > </p >

<div >

<div class=MsoNormal align=center style= 'text-align:center ' > <font size=3
face= "Times New Roman " > <span style= 'font-size:12.0pt ' >

<hr size=2 width= "100% " align=center tabIndex=-1 >

</span > </font > </div >

<p class=MsoNormal > <b > <font size=2 face=Tahoma > <span style= 'font-size:10.0pt;
font-family:Tahoma;font-weight:bold ' >From: </span > </font > </b > <font size=2
face=Tahoma > <span style= 'font-size:10.0pt;font-family:Tahoma ' >
oracle-l-bounce@(protected) [mailto:oracle-l-bounce@(protected)] <b > <span
style= 'font-weight:bold ' >On Behalf Of </span > </b >Khedr, Waleed <br >
<b > <span style= 'font-weight:bold ' >Sent: </span > </b > 02 June 2004 14:10 <br >
<b > <span style= 'font-weight:bold ' >To: </span > </b > oracle-l@(protected) <br >
<b > <span style= 'font-weight:bold ' >Subject: </span > </b > RE: library cache lock </span > </font > <o:p > </o:p > </p >

</div >

<p class=MsoNormal > <font size=3 face= "Times New Roman " > <span style= 'font-size:
12.0pt ' > <o:p >  </o:p > </span > </font > </p >

<div >

<p class=MsoNormal > <font size=2 color=blue face= "Times New Roman " > <span
style= 'font-size:10.0pt;color:blue ' >The metalink has answers for similar
issues. </span > </font > <o:p > </o:p > </p >

</div >

<div >

<p class=MsoNormal > <font size=3 face= "Times New Roman " > <span style= 'font-size:
12.0pt ' >  <o:p > </o:p > </span > </font > </p >

</div >

<blockquote style= 'margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt ' >

<p class=MsoNormal style= 'margin-bottom:12.0pt ' > <font size=2 face=Tahoma > <span
style= 'font-size:10.0pt;font-family:Tahoma ' >-- --Original Message-- -- <br >
<b > <span style= 'font-weight:bold ' >From: </span > </b > David Sharples
[mailto:dsharples@(protected)] <br >
<b > <span style= 'font-weight:bold ' >Sent: </span > </b > Wednesday, June 02, 2004
8:44 AM <br >
<b > <span style= 'font-weight:bold ' >To: </span > </b > oracle-l@(protected) <br >
<b > <span style= 'font-weight:bold ' >Subject: </span > </b > library cache lock </span > </font > <o:p > </o:p > </p >

<p > <font size=2 face=Arial > <span lang=EN-GB style= 'font-size:10.0pt;font-family:
Arial ' > <!-- Converted from text/rtf format -- >Hi, got a strange problem. 
I am trying to truncate a partition in a table, but it just hangs forever, it
is waiting on a library cache lock.  Anyone know why and how I can clear
it </span > </font > <span lang=EN-GB > </span > <font size=2 face=Arial > <span
lang=EN-GB style= 'font-size:10.0pt;font-family:Arial ' >– </span > </font > <span
lang=EN-GB > </span > <font size=2 face=Arial > <span lang=EN-GB style= 'font-size:
10.0pt;font-family:Arial ' >flushing the shared pool </span > </font > <span
lang=EN-GB > </span > <font size=2 face=Arial > <span lang=EN-GB style= 'font-size:
10.0pt;font-family:Arial ' >didn’t help and there are no other sessions
touching that table. </span > </font > <o:p > </o:p > </p >

<p > <font size=2 face=Arial > <span lang=EN-GB style= 'font-size:10.0pt;font-family:
Arial ' >Thanks </span > </font > <o:p > </o:p > </p >

<p > <font size=2 face=Arial > <span lang=EN-GB style= 'font-size:10.0pt;font-family:
Arial ' >Dave </span > </font > <o:p > </o:p > </p >

</blockquote >

</blockquote >

</div >

</body >

</html >