先查看哪些表被锁住了 select b.username,b.sid,b.serial#,logon_time from v$locked_object a,v$session b where a.session_id = b.sid and sid in( select a.SESSION_ID from v$locked_object a,dba_objects b where b.object_id = a.object_id and object_name ='HDM_COMPLETE
查询锁表
select object_name,machine,s.sid,s.serial#
from v$locked_object l,dba_objects o ,v$session s
where l.object_id = o.object_id and l.session_id=s.sid ;
杀表(程序内杀)
alter system kill session '543,9206';
如果杀不掉可以查这个来获取spid(将获取的spid给有权限的网络管理员,他就给你杀了
在Oracle中查询锁表及解锁:
锁表查询的代码有以下的形式:
select count(*) from v$locked_object;
select * from v$locked_object;
查看哪个表被锁:
select b.owner,b.object_name,a.session_id,a.locked_mode from v$locked_object a,dba_objects b where b.object_id = a.object_id;
查看是哪个session
废话不多说 上语句:
查询锁表语句:
select object_name,machine,s.sid,s.serial#
from v$locked_object l,dba_objects o ,v$session s
where l.object_id = o.object_id and l.session_id=s.sid;
杀掉查到的进程:
alter system kill session 'sid,serial#';
例如:
alter system kill session