Library cache lock (%)


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.

Metric Summary

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


Default Warning Threshold

Default Critical Threshold

Consecutive Number of Occurrences Preceding Notification

Alert Text


Every Minute

After Every Sample



Not Defined


%value%%% of service time is spent waiting on the 'library cache lock' event.

Data Source

(DeltaLibraryCacheLockTime/DeltaServiceTime)*100 where:

See Idle Events

User Action

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,
    v$sql sql,
    v$session s,
    x$kgllk l,
    v$session_wait waiter,
    v$session_wait holder
    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
    waiter.p1raw ,
    waiter.p2raw ,
    holder.event ,
    holder.p1raw ,
    holder.p2raw ,

Related Topics

About Alerts

About the Metric Detail Page

Editing Thresholds

Understanding Line Charts