数据库版本: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:
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
- 
Apply 
Patch 21293453
 Or use following workarounds:
- 
Kill the blocker session
 Or
- Stop db console (or cloud control)