WAITEVENT: "library cache pin" Reference Note [ID 34579.1]


修改时间 17-SEP-2011     类型 REFERENCE     状态 PUBLISHED 

"library cache pin" Reference Note

This is a reference note for the wait event "library cache pin" which includes the following subsections:See Note:61998.1 for an introduction to Wait Events.

Definition:

  • Versions:7.0 - 11.1 Documentation: 11g 10.2
  • Library cache pins are used to manage library cache concurrency. Pinning an object causes the heaps to be loaded into memory (if not already loaded). PINS can be acquired in NULL, SHARE or EXCLUSIVE modes and can be considered like a special form. of lock. A wait for a "library cache pin" implies some other session holds that PIN in an incompatible mode.

Individual Waits:

  Parameters:

  Wait Time:

The waiter waits up to 3 seconds (1 second if PMON) for the PIN to become available. If not available then the session waits again, incrementing SEQ# in <> .

  Finding Blockers:

The following SQL can be used to show the sessions which are holding and/or requesting pins on the object that given in P1 in the wait:
  SELECT s.sid, kglpnmod "Mode", kglpnreq "Req"
    FROM x$kglpn p, v$session s
   WHERE p.kglpnuse=s.saddr
     AND kglpnhdl='&P1RAW'
  ;
An X request (3) will be blocked by any pins held S mode (2) on the object.
An S request (2) will be blocked by any X mode (3) pin held, or may queue behind some other X request.

Diagnosis of why there is a blocking scenario will usually need help from Oracle support. If you just want to clear the immediate issue then the SID information above should allow you to kill off any blocking sessions. Proper diagnosis will usually require you to collect 3 SYSTEMSTATE and/or HANGANALYZE dumps at 30 seconds intervals then submit these to Oracle support with full details of the sessions and objects involved. To take a SYSTEMSTATE or HANGANALYZE dump connect to the instance as a user with ALTER SYSTEM privilege and issue the command:

  ALTER SESSION SET max_dump_file_size = UNLIMITED;
  ALTER SYSTEM SET EVENTS 'immediate trace name systemstate level 266';
This will produce a trace file under the DIAGNOSTIC_DEST in 11g, or in the USER_DUMP_DEST in earlier releases (or BACKGROUND_DUMP_DEST if connected to a shared server).
In a Parallel Server or RAC environments SYSTEMSTATE dumps should be taken 3 times on each node.

Systemwide Waits:

If "library cache pin" waits form. a significant amount of the wait time then it is important to determine if this is one or two sessions waiting long periods of time or a more serious general contention issue among lots of processes.

Reducing Waits / Wait times:

What to do to reduce these waits depends heavily on what blocking scenario is occuring. A common problem scenario is the use of DYNAMIC SQL from within PLSQL procedure where the PLSQL code is recompiled and the DYNAMIC SQL calls something which depends on the calling procedure.

Known Bugs
You can restrict the list below to issues likely to affect one of the following versions by clicking the relevant button: 
           


NBBugFixedDescription
1241174612.1.0.0RAC waits for "library cache pin" do not time out (do not trigger ORA-4021)
1013892911.2.0.3, 12.1.0.0ORA-600 [17069] in replication receiver / self deadlock on replication internal package
932792911.2.0.2ORA-600 [kglLockOwnersListDelete] / DIRECTORY object waits using EXTERNAL tables
661831211.1.0.7, 11.2.0.1Deadlock between ON COMMIT materialized view refresh and query rewrite (library cache pin V lock deadlock)
647568811.1.0.7, 11.2.0.1Concurrent rewrite and on-commit refresh can deadlock (library cache pin <--> lock)
664412210.2.0.5, 11.1.0.7ON COMMIT refresh deadlock (library cache pin V lock)
560469810.2.0.4, 11.1.0.6Deadlock between 'library cache lock' and 'library cache pin' using replication
722646310.2.0.5EXECUTE IMMEDIATE no releasing mutex or library cache pin
37176199.2.0.6, 10.1.0.4, 10.2.0.1Deadlock/hang possible due to concurrent cursor loads referencing same INVALID trigger
36051659.2.0.6, 10.1.0.4, 10.2.0.1Hang/deadlock between sessions concurrently loading a cursor with INVALID trigger
337464010.1.0.3, 10.2.0.1Create local partitioned domain index can hang
32537709.2.0.6, 10.1.0.3, 10.2.0.1ORA-4021 / "library cache pin" waits on RAC executing Java stored procedures
+29687099.2.0.5, 10.1.0.2High "library cache pin" waits possible
33710039.2.0.6Logical standby apply hang (library cache pin waits)
33529029.2.0.6Logical apply may hang (library cache pin)
  • '*' against a bug indicates that an alert exists for that issue.
  • '+' indicates a particularly notable bug.
  • 'P' indicates a port specific bug.
  • "OERI:nnnnn" is used as shorthand for ORA-600 [nnnnn].

Related:

Tracing User sessions Note:62160.1 
Shared Pool Tuning Note:62143.1 

Important:

The above text makes reference to some X$ views. These are only visible to the SYS user and are not guaranteed to be available on all versions of Oracle. Customers are advisedNOT to have any application code or scripts which rely on any X$ view.


显示相关信息 相关内容


产品
  • Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
关键字
BUGTAG_ADDBUGS

返回页首返回页首

请使用浏览器的分享功能分享到微信等