Database Administration (MOSC)

MOSC Banner

How to kill not active sessions from database?

edited May 22, 2018 10:11PM in Database Administration (MOSC) 1 comment

How to kill not active sessions from database?

best reagrds
Magdy Mohanna
IT Manager

Hi,
Retrieve the sid and serial# from v$session for the inactive session and run below command

alter system kill session 'sid,serial#';

Thanks,
Ravi
Hi ,


SELECT SID, SERIAL#, STATUS,USERNAME,PROGRAM  FROM V$SESSION WHERE status='INACTIVE'

ALTER SYSTEM KILL SESSION '<SID>,<SERIAL#>';

Where SID and serial# value you would get from above

When an inactive session has been terminated, the STATUS of the session in the V$SESSION view is KILLED.

Regards

Dear Magdy IT Manager,

now you know how to kill "not active sessions"... But think  7 times before doing it.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center