ORA-04021: timeout occurred while waiting to lock object

dmcatding發表於2019-07-08

資料庫版本:11.2.4.0

作業系統:AIX 6.1


SQL> drop user PATROL2;

*

ERROR at line 1:

ORA-04021:timeout occurred while waiting to lock object


檢視SID 242


kill 掉非本地程式

再次DROP 使用者正常


MOS:

CAUSE

This is most likely due to following internal bug:

 - QUERY EXECUTED BY DBSNMP HOLDS LIBRARY CACHE LOCK FOR LIFE OF SESSION

SQL statements that make use of the new GV$() function would acquire a
librarycache (KGL) lock for session duration. One example of such a SQL statement is:

SELECT c FROM table(GV$(cursor(select count(*) c from
v$active_session_history where is_awr_sample='Y')));

These locks are acquired in shared mode but will block other operations that
require an exclusive mode lock.

If you are seeing exclusive library cache locks against GV$ related objects
where the holder has acquired the lock in shared mode and has executed a
SQL statement that involves a GV$() function then you might be seeing this
problem.



Unable To Drop User Due to Ora-4021 (文件 ID 2325903.1)

SOLUTION

  1. Apply 
    Or use following workarounds:
  2. Kill the blocker session
    Or
  3. Stop db console (or cloud control)




來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30327022/viewspace-2649844/,如需轉載,請註明出處,否則將追究法律責任。

相關文章