ORA-00054:resource busy and acquire with NOWAIT specified

[Oracle]

今天对一个数据量很大的表进行操作时,出现如题所示的异常。此时表明数据库的事务处于“忙”的状态,而且被lock了,所以必须先关闭占用的session。

step1,查看被lock的session:

select t2.username, t2.sid, t2.serial#, t2.logon_time
  from v$locked_object t1, v$session t2
 where t1.session_id = t2.sid
 order by t2.logon_time;

step2,kill掉该session:

alter system kill session '391,27444'

 其中391为step1表中查到的sid,27444为step1表中查到的serial#。反复执行,直到step1表中的数据为空为止。

这样即可关闭占用锁的session了。

猜你喜欢

转载自raising.iteye.com/blog/2217378
今日推荐