ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ORA-04021

ORA-04021

原创 Linux操作系统 作者:dragondb 时间:2019-05-30 07:03:08 0 删除 编辑

ORA-04021 timeout occurred while waiting to lock object stringstringstringstringstring

Cause: While waiting to lock a library object, a timeout is occurred.

Action: Retry the operation later.


来自: Oracle, Aaron Wang 01-Aug-01 19:33
主题: Re : alter package compile -> timeout occurred while waiting to lock object

To find out who is blocking you, run the query in another session while you're compiling.
Kill the offending session, and your complilation should go through.

set line 128

SELECT sid, DECODE( block, 0, 'NO', 'YES' ) BLOCKER,
DECODE( request, 0, 'NO', 'YES' ) WAITER, id1, id2, lmode /* 6 is exclusive lock. For others, refer to SV10 */
FROM v$lock
WHERE request > 0 OR block > 0
ORDER BY block DESC
/

To find out what objects is being hold

set line 128

SELECT b.object_name,
decode( a.locked_mode,
0, 'None', /* Mon Lock equivalent */
1, 'Null', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Exclusive',
a.locked_mode) Locked_Mode, /* X */
session_id, oracle_username, os_user_name, process
FROM v$LOCKED_OBJECT a, ALL_OBJECTS b
WHERE a.object_id = b.object_id
and a.locked_mode in (3, 5, 6)
and a.session_id=&sid;

The reason the session is marked KILLED is because Oracle only remove the entry from v$session
when you try to use the session again. If this case, your session has already crashed (closed),
there's no way you can use it again. So another way is to remove it from OS level.
If you're running unix, you can use a KILL command to do that.

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

上一篇: ASCII Character Set
下一篇: Win Resource Kits
请登录后发表评论 登录
全部评论

注册时间:2003-05-05

  • 博文量
    98
  • 访问量
    94093