Finding out who's connected to an Oracle instance and killing Oracle sessions

From SquadLimberWiki

Jump to: navigation, search

Find out which database user and host is connected to an Oracle session

sqlplus "/as sysdba"
> select username, machine from v$session;


Kill an Oracle user session via SQL

> select sid, serial#, username, machine from v$session;
> alter system kill session 'sid,serial#';

or...

> alter system kill session 'sid,serial#' immediate;


Kill a local process connected to Oracle

> select s.sid, p.spid, s.osuser, s.program from v$process p, v$session s where p.addr = s.paddr;

then from a unix shell...

$ kill spid
Personal tools