报错:

SQL>drop table shiyue.t;

droptable shiyue.t

*

ERRORat line 1:

ORA-00054:resource busy and acquire with NOWAIT specified or timeout expired


问题分析:

由于之前同时对同一张表进行update操作,并且没有做commit操作,强行终止后导致事物被锁,对表操作报ORA-00054: resource busy and acquire with NOWAIT specified ortimeout expired错误。


解决方案:

1、 用dba权限的用户查看数据库都有哪些锁
select t2.username,t2.sid,t2.serial# from v$locked_object t1,v$session t2
where t1.session_id=t2.sid

2、 根据sid查看具体的sql语句,如果sql不重要,可以kill
select sql_text

from  v$sqltext awhere a.hash_value = (select sql_hash_value from v$session b where b.sid = ’&sid’)

3、 kill该事务
alter system kill session ’sid,serial#’;