Thứ Hai, 6 tháng 7, 2015

KILL DDL_LOCK ON ORACLE DATABASE



1/ To Determine sid,spid of session that is cause of DDL lock.

SELECT s.inst_id,
       s.sid,
       s.serial#,
       p.spid,
       s.username,
       D.NAME,
       D.TYPE,
       s.program
FROM   gv$session s, gv$process p, DBA_DDL_LOCKS d where p.addr = s.paddr AND p.inst_id = s.inst_id and s.type != 'BACKGROUND' and s.sid=D.SESSION_ID;

2/ Kill the session:

- Windows: orakill oracle_sid spid
- Linux: kill -9 spid

Không có nhận xét nào: