Find and kill Oracle sessions

5 Feb

Query to find session:

SELECT s.inst_id,
s.sid,
s.serial#,
p.spid,
s.username,
s.program,
s.osuser,
s.machine
FROM gv$session s
JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id
WHERE s.TYPE != ‘BACKGROUND’;

 

Kill session:

ALTER SYSTEM KILL SESSION ‘sid,serial#’;

 

Read more

http://www.oracle-base.com/articles/misc/killing-oracle-sessions.php

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: