從OS中kill ORACLE死鎖程式

ningzi82發表於2010-08-20

1.查詢死鎖程式

SQL> 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;

2.從ORACLE中KILL死鎖程式

SQL> alter system kill session '3278,24961';
alter system kill session '3278,24961'
*
ERROR at line 1:
ORA-00031: session marked for kill

3.查詢在OS中的SPID
SQL> select spid, osuser, s.program
2 from v$session s,v$process p
3 where s.paddr=p.addr and s.sid=&sid;
Enter value for sid: 3278
old 3: where s.paddr=p.addr and s.sid=&sid
new 3: where s.paddr=p.addr and s.sid=3278

SPID OSUSER
------------ ------------------------------
PROGRAM
------------------------------------------------
18351 oracle
sqlplus@STCS-MES-ARC (TNS V1-V3)


SQL> exit

4.從OS中KILL
$ kill -9 18351

[@more@]

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

相關文章