What is the "Library cache lock"?
This event controls the concurrency between clients of the library cache. It acquires a lock on the object handle so that either:
- One client can prevent other clients from accessing the same object.
- The client can maintain a dependency for a long time (for example, so and no other client can change the object).
This lock is a also obtained to locate a object in the library cache.
Library Cache lock would be obtained on database objects referenced during parsing or compiling of SQL or PL/SQL statements (table, view, procedure, function, package, package body, trigger, index, cluster, synonym). The lock'll be released at the end of the parse or compilation.
Cursors (SQL and PL $ areas), pipes and any other transient objects does not use the this lock.
The Library cache lock is a deadlock sensitive and the operation is synchronous.
Parameters:
- Handle Address
Address of the object being loaded.
- Lock Address
Address of the load lock being used. The same thing as a latch or an enqueue, it's a state Object.
- Mode
Indicates the data pieces of the object which need to be loaded.
- Namespace
The name of the object namespace as it is displayed in V$db_object_cache view
What is the "Library cache pin"?
This event manages the library cache concurrency. Pinning an object causes the heaps to is loaded into memory. If a client wants to modify or examine the object, the client must acquire a PIN after the lock. Pin can is acquired in NULL, SHARE or EXCLUSIVE modes and can be considered as a special form of lock. A wait for a "library cache pin" implies some the other session holds the PIN in an incompatible mode.
Library cache pin'll be obtained on a database object that's currently cached in the library cache (table, view, proced Ure, function, package, package body, trigger, index, cluster, synonym). In the library cache, a database object was cached in 2 parts: "Handle" and "object". The Library cache pin is a held when the ' object ' part is cached.
It isn't deadlock sensitive and the operation is synchronous
Library Cache:lock, Pin and Load Lock