ITPub博客

首页 > 数据库 > Oracle > ORA-04021: timeout occurred while waiting to lock object

ORA-04021: timeout occurred while waiting to lock object

原创 Oracle 作者:dmcatding 时间:2019-07-08 15:20:46 0 删除 编辑

数据库版本: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:

BUG 21293453  - 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  Patch 21293453
    Or use following workarounds:
  2. Kill the blocker session
    Or
  3. Stop db console (or cloud control)




来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30327022/viewspace-2649844/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
此BLOG仅作为个人笔记记录,如有误肯请各位指正,谢谢!

注册时间:2015-07-04

  • 博文量
    91
  • 访问量
    190114