killing inactive session..
417430Oct 6 2008 — edited Oct 6 2008Hello,
I wanted to run the script to kill any session is inactive for last four hours.
Here is the script i am using.
SELECT 'ALTER SYSTEM KILL SESSION '||''''||sid||','||serial#||''''||' immediate;'
FROM v$session
WHERE status ='INACTIVE'
and logon_time <= sysdate - (4*(60/1440))
and UPPER(machine) IN(
UPPER('APPSERVER1'),
UPPER('APPSERVER2'),
UPPER('APPSERVER3'))
Let us say, user logon at 8AM and he/she works continuously for 4 or 5 hours. and the system is idle
for some time and session becomes inactive. So, the system is not really inactive for 4 hours. I am little
confused how i can find out the session are inactive for last four hours..
My ultimate question is, When oracle marks the V$SESSION.STATUS field as INACTIVE?
What is the time gap between changing the status from ACTIVE to INACTIVE?
Any help appreicated.