Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

killing inactive session..

417430Oct 6 2008 — edited Oct 6 2008
Hello,

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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 3 2008
Added on Oct 6 2008
1 comment
1,503 views