Kill Oracle sessions

Some time the Oracle connections stay open, blocking the other transactions, there’s no other option than kill it.
We firstly need to identify it, as system user, execute the following query:

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.type != 'BACKGROUND';

Check the connection you need to kill, and:

ALTER SYSTEM KILL SESSION 'sid,serial#'

Now, you have your licence to kill! 😀

Leave a comment