latch:library cache lock等待事件
latch: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, no other client can change the object)
This lock is also obtained to locate an object in the library cache.
Oracle needs Library Cache Lock and Library Cache Pin for the compilation and parsing of packages, procedures, functions, and other objects. This is to ensure that no one is using the object during compilation/parsing since changes are being made to the definition of the object.
Problem
This wait can occur when DDL is being executed on an object or one of its dependant objects. This causes a database object invalidation. Typically these are the object maintenance operations such as: ALTER, GRANT, and REVOKE. After object invalidation, Oracle tries to recompile the object at the time of the next access attempt. This may be a problem in a case where other sessions have pinned the object in the library cache because they are actively accessing the object. This is more likely to occur with more active users and with more complex dependencies (e.g. many cross-dependent packages or package bodies). In some cases, waiting for object recompilation may take hours, blocking all the sessions trying to access it.
Typical Scenarios
A DML operation that is hanging because the table which is accessed is currently undergoing changes (ALTER TABLE). This may take quite a long time depending on the size of the table and the type of the modification (e.g. ALTER TABLE MODIFY col1 CHAR(200) on millions of records).
The compilation of package will hang on Library Cache Lock and Library Cache Pin if some users are executing any procedure or function defined in the same package.
Sessions trying to access objects that have recently been modified in some way may have to wait while objects are recompiled.
Solution
If a session is hanging on this wait, it is possible to find its blocker and kill it. Refer to MetaLink Note: 122793.1 for details on how to find the blocker.
For a long-term fix, look at any processes or applications that might cause object invalidations and limit or time their execution for minimal impact. Be very careful with altering, granting or revoking privileges on database objects that frequently used PL/SQL is dependent on.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31520497/viewspace-2156806/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【TUNE_ORACLE】等待事件之“library cache lock”Oracle事件
- 【等待事件】library cache pin事件
- [20240827]分析為什麼出現library cache lock等待事件2.txt事件
- [20240828]分析為什麼出現library cache lock等待事件5.txt事件
- library cache pin和library cache lock(一)
- library cache pin和library cache lock (zt)
- library cache pin和library cache lock(二)
- 【TUNE_ORACLE】等待事件之“library cache pins”Oracle事件
- library cache lock和library cache bin實驗_2.0
- Library Cache最佳化篇(一)降低library cache lock和library cache pin的方法
- latch等待事件彙總事件
- Latch free等待事件(轉)事件
- [20240920]跟蹤library cache lock library cache pin使用gdb.txt
- [20240824]跟蹤library cache lock library cache pin使用gdb.txt
- Oracle 11g 密碼延遲認證與 library cache lock 等待Oracle密碼
- Latch free等待事件四(轉)事件
- Latch free等待事件三(轉)事件
- Latch free等待事件二(轉)事件
- [20190319]shared pool latch與library cache latch的簡單探究.txt
- [20210512]shared pool latch與library cache latch的簡單探究.txt
- 重啟大法失效?詳述Oracle11g因JDBC bug引發異常Library Cache Lock等待處理事件OracleJDBC事件
- Library Cache 診斷:Lock, Pin 以及 Load Lock (文件 ID 1548524.1)
- 一次library cache lock 問題分析
- [20241105]跟蹤library cache lock library cache pin使用gdb(11g)2.txt
- [20241108]跟蹤library cache lock library cache pin使用gdb(11g)4.txt
- [20241108]跟蹤library cache lock library cache pin使用gdb(11g)3.txt
- LightDB/PostgreSQL等待事件 Lock transactionidSQL事件
- 當刪除oracle資料庫user時發生row cache lock 等待事件Oracle資料庫事件
- 等待事件enq: TX - row lock contention事件ENQ
- [異常等待事件latch undo global data]分析事件
- 【ASM_ORACLE】Library Cache最佳化篇(二)Library cache load lock的概念和解決辦法ASMOracle
- 【ASK_ORACLE】Library cache pin 與 library load lock的關係和區別Oracle
- ORACLE LOCK,LATCH,PINOracle
- [20211229]再論19c latch free等待事件分析.txt事件
- [20210520]11g shared pool latch與library cache mutex的簡單探究.txtMutex
- 徹底搞清楚library cache lock的成因和解決方法(轉)
- Oracle Library cacheOracle
- mutex,latch,lock,enqueue hash chains latch基礎概念MutexENQAI