查看锁表进程SQL语句1: select sess.sid sess.serial# lo.oracle_username lo.os_user_name ao.obxxxxject_name lo.locked_mode
from v$locked_obxxxxject lo dba_obxxxxjects ao v$session sess where ao.obxxxxject_id = lo.obxxxxject_id and lo.session_id = sess.sid;
查看锁表进程SQL语句2:
select * from v$session t1 v$locked_obxxxxject t2 where t1.sid = t2.SESSION_ID;
杀掉锁表进程:
如有記錄則表示有lock,記錄下SID和serial# ,將記錄的ID替換下面的7381429,即可解除LOCK
alter system kill session '7381429';
--查询语句 select b.sid sid c.serial# serial c.username username c.osuser osuser c.terminal terminal
decode(b.id20'对象锁''事务-'||to_char(b.id1)) trans_id b.type type
decode(b.lmode0'等待'1'空'2'行子共享模式(SS)'3'行共享互斥模式(SX)' 4'共享模式(S)'5'行子共享互斥模式(SRX)'6'互斥模式(X)'b.lmode) lmode decode(b.request' '1'空'2'行子共享模式(SS)'3'行共享互斥模式(SX)' 4'共享模式(S)'5'行子共享互斥模式(SRX)'6'互斥模式(X)' b.request) request b.ctime ctime
decode(b.block0 '不阻塞'1 '阻塞'2 '全局锁'to_char(block)) block from v$lock bv$session c where b.sid=c.sid
and c.username is not null
order by b.sidb.id2;