對於死鎖的處理流程:

huangdazhu發表於2014-10-13
對於死鎖的處理流程:
1,查詢鎖:
select ls.osuser os_user_name,
ls.username user_name,
ls.type lock_type,
o.object_name object,
decode(ls.lmode,1,null,2,'Row Share',3,'Row Exclusive',4,'Share',5,'Share Row Exclusive',6,'Exclusive',null) lock_mode,
o.owner,
ls.sid,
ls.serial# serial_num,
ls.id1,ls.id2,
ls.paddr
 from sys.dba_objects o,
(select s.osuser,s.username,l.type,s.paddr,l.lmode,s.sid,s.serial#,l.id1,l.id2  from v$session s,v$lock l where s.sid=l.sid) ls
where o.object_id=ls.id1 and o.owner<>'SYS' order by o.owner,o.object_name
2,查詢spid
select a.spid,a.username,b.program  from v$process a,v$session b where a.addr=b.paddr and a.addr='000007FF2DC8E578';
3、kill程式
alter system kill session 'sid,serial#' immediate;
orakill sid spid
sid:表示要殺死的程式屬於的例項名
thread:是要殺掉的執行緒號,即第2步查詢出的spid。 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28869493/viewspace-1296998/,如需轉載,請註明出處,否則將追究法律責任。

相關文章