Thanks in advance.select username, machine, program, to_char(LOGON_TIME, 'hh24:mi:ss DD-MM-YYYY'), LAST_CALL_ET/60, status from gv$session where status='INACTIVE';
How about if a session has been INACTIVE for last three days and the LAST_CALL_ET doesn't change and keeps on increasing?Again, this doesn't make sense. Sessions change their state to 'INACTIVE' as soon as the client application doesn't submit a statement.
So all sessions change from 'ACTIVE' to 'INACTIVE' and back to 'ACTIVE' all the time.
So filtering on state 'INACTIVE' will not provide an accurate picture.
Yes, i agree it's not a good idea killing or cleaning up inactive sessions without knowing it's reaosn.I believe you are missing the point. Just because a session happens to be inactive for a moment does Not mean it needs to be killed or cleaned up. In fact this is a very bad idea.