用sys登陆oracle 然后执行
[quote]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 [/quote]
检查出来谁锁了该表
查看结果中object_name='你的表名'
然后得到sid,serial#
杀掉锁定的进程
select 'alter system kill session '''||sid||','||serial#||''';' from v$session where username='MESSAGE';
[quote]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 [/quote]
检查出来谁锁了该表
查看结果中object_name='你的表名'
然后得到sid,serial#
杀掉锁定的进程
alter system kill session '99,44150'
select 'alter system kill session '''||sid||','||serial#||''';' from v$session where username='MESSAGE';