Oracle: Resolve blocking processes

By | February 8, 2017

Sometimes an oracle query goes nuts and blocks the DB.
To find the blocked processes started by user MYUSER execute:


SELECT s.inst_id,
s.sid,
s.serial#,
p.spid,
s.username,
s.program FROM gv$session s
JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id
where s.username like 'MYUSER';

To kill the blocking process:


ALTER SYSTEM KILL SESSION 'sid,serial#'

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.