1、当前session中commit、rollback都可以解锁
2、在别的session中(DBA)通过
查找用户锁
select s.username,
decode(l.type,'TM','TABLE LOCK',
'TX','ROW LOCK',
NULL) LOCK_LEVEL,
o.owner,o.object_name,o.object_type,
s.sid,s.serial#,s.terminal,s.machine,s.program,s.osuser
from v$session s,v$lock l,dba_objects o
where s.sid=l.sid
and o.object_id=l.id1
and s.username is not null
检查出来谁锁了该表
查看结果中object_name='你的表名'
然后得到sid,serial#
alter system kill session 'sid, serial#'
or
alter system disconnect session 'sid, serial#' immediate;
3、select * from table for update nowait可以指定nowait
----------------------------------------
一个问题不要问两遍
2、在别的session中(DBA)通过
查找用户锁
select s.username,
decode(l.type,'TM','TABLE LOCK',
'TX','ROW LOCK',
NULL) LOCK_LEVEL,
o.owner,o.object_name,o.object_type,
s.sid,s.serial#,s.terminal,s.machine,s.program,s.osuser
from v$session s,v$lock l,dba_objects o
where s.sid=l.sid
and o.object_id=l.id1
and s.username is not null
检查出来谁锁了该表
查看结果中object_name='你的表名'
然后得到sid,serial#
alter system kill session 'sid, serial#'
or
alter system disconnect session 'sid, serial#' immediate;
3、select * from table for update nowait可以指定nowait
----------------------------------------
一个问题不要问两遍
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货