解除Oracle死锁

查询锁
SELECT   /*+ rule */   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  l.sid = s.sid 
AND  l.id1 = o.object_id(+)
AND  s.username  is   NOT   NULL
and  object_name  like   '%P2002%'

kill掉持有锁的会话
alter system kill session           '74,1620'

在kill会话的时候可能会出现:session marked for kill;
处理方式如下:
查询相关进程
select  spid, osuser, s.program
from  v$session s,v$process p
where  s.paddr=p.addr  and   s.sid=  74
然后kill掉对应的进程

你可能感兴趣的:(oracle,session,死锁,for,K,marked)