-- Get ORACLE Session IDs (SID and SERIAL#)
SELECT SID, SERIAL#, STATUS, SERVER FROM V$SESSION WHERE USERNAME = '<username>';
-- Kill session (and wait for rollback if any...)
ALTER SYSTEM KILL SESSION 'SID,SERIAL#' IMMEDIATE;
select 'ALTER SYSTEM KILL SESSION '''||SID||','||SERIAL#||''' IMMEDIATE;' from v$session where status <> 'ACTIVE';
ALTER SYSTEM DISCONNECT SESSION 'sid,serial#' POST_TRANSACTION;
ALTER SYSTEM DISCONNECT SESSION 'sid,serial#' IMMEDIATE;