The library cache lock controls the concurrency between clients of the library cache by acquiring a lock on the object handle so that one client can prevent other clients from accessing the same object or the client can maintain a dependency for a long time (no other client can change the object). This lock is also gotten to locate an object in the library cache.
Blocking situations can occur when two sessions compile the same PL/SQL package, or one session is recreating an index while another session is trying to execute a SQL statement that depends on that index.
The rest of the information in this section is only valid for this metric when it appears in either the Enterprise Manager Grid Control or the Enterprise Manager Database Control (if applicable).
The following table shows how often the metric's value is collected and compared against the default thresholds. The 'Consecutive Number of Occurrences Preceding Notification' column indicates the consecutive number of times the comparison against thresholds should hold TRUE before an alert is generated.
Target Version |
Evaluation and Collection Frequency |
Upload Frequency |
Operator |
Default Warning Threshold |
Default Critical Threshold |
Consecutive Number of Occurrences Preceding Notification |
Alert Text |
pre-10g |
Every Minute |
After Every Sample |
> |
20 |
Not Defined |
3 |
%value%%% of service time is spent waiting on the 'library cache lock' event. |
(DeltaLibraryCacheLockTime/DeltaServiceTime)*100 where:
DeltaLibraryCacheLockTime: difference of 'sum of time waited for sessions of foreground processes on the 'library cache lock' event' between sample end and start
DeltaServiceTime: difference of 'sum of time waited for sessions of foreground processes on events not in IdleEvents + sum of 'CPU used when call started' for sessions of foreground processes' between sample end and start
See Idle Events
Waiting for a load lock indicates that there is a blocker with a higher or incompatible mode. Locks map to Instance Locks.
The following query will list waiters and the holder of the resource along with the event the resource holder is waiting for.
column h_wait format A20 SELECT s.sid, waiter.p1raw w_p1r, waiter.p2raw w_p2r, holder.event h_wait, holder.p1raw h_p1r, holder.p2raw h_p2r, count(s.sid) users_blocked, sql.hash_value FROM v$sql sql, v$session s, x$kgllk l, v$session_wait waiter, v$session_wait holder WHERE s.sql_hash_value = sql.hash_value and l.KGLLKADR=waiter.p2raw and s.saddr=l.kgllkuse and waiter.event like 'library cache lock' and holder.sid=s.sid GROUP BY s.sid, waiter.p1raw , waiter.p2raw , holder.event , holder.p1raw , holder.p2raw , sql.hash_value ;
Related Topics
About Alerts
About the Metric Detail Page
Editing Thresholds
Understanding Line Charts
Copyright © 1996, 2009, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.