今天往一个表里面多增加了两个字段,修改完毕,保存的时候,提示如下内容:“资源正忙,要求指定nowait”。重试好几遍,都没有解决,于是搜索了一下,找到了解决方法,如下:
首先执行下面一段代码,得到锁定的进程:
select
t1.sid, t1.serial#, t1.username, t1.logon_time
from v$session t1 , v$locked_object t2
where t1.sid = t2.session_id
order by t1.logon_time;
t1.sid, t1.serial#, t1.username, t1.logon_time
from v$session t1 , v$locked_object t2
where t1.sid = t2.session_id
order by t1.logon_time;
可以得到进程的SID和SERIAL#序号,然后按照下列语句解锁:
alter system kill session 'sid,serial#';
即可,这里我们输入:
alter system kill session '3332,41117#';