| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Autologout of idle users
On Wednesday 06 June 2001 16:56, Mark Liggayu wrote:
> What commant should I use to automatically logout uses in oracle who has
> been idle for more than 30 minutes?
> We have UNIX as an OS.
>
> Thanks,
> Mark
Mark,
You can create a profile that has an idle time limit.
The problem with that is that the session is not really removed from the instance, but the session status is changed to SNIPED.
This means that when the user tries to do more work after the session has timed out, an error will be generated.
e.g. ORA-02396: exceeded maximum idle time, please connect again
While this process makes the user login again, it does nothing to release resources. Try this experiment. Create profile, assign it to a user, login via sqlplus and wait for the session to timeout. At that time look at the session info and you will see that database/OS resources are still being consumed.
create profile idle_limit limit idle_time 1; alter user scott profile idle_limit;
You will notice that while the idle_limit is set to 1 minute, the timeout will not occur until 3 minutes, as that is the minimum allowed idle_time.
Also, if you don't have resource limiting turned on, do this:
alter system set resource_limit = true;
Check v$session status, and server process id:
select
s.username, s.sid, s.serial#, p.pid ppid, s.status, s.machine, s.osuser,
You will likely see that SCOTT is still logged in with a STATUS of SNIPED;
Take a look at v$wait and you will see that SCOTT is being waited on:
select
s.username username, e.event event, s.sid, e.p1text, e.p1, e.p2text, e.p2, e.wait_time, e.seconds_in_wait, e.state
and s.sid = e.sid
order by s.username, upper(e.event);
Something new happened in 8.1.7 while testing this, after a few more minutes the session for SCOTT was actually removed. I can't remember what version it was last time I tested this, but the session remained until SCOTT logged out or the session was killed.
One thing that hasn't changed is that the shadow process will continue to exist until SCOTT logs out or you kill the process.
If you use IDLE_LIMIT, you will need to check frequently for SNIPED sessions and kill the OS process to avoid collecting a lot of extra useless processes.
Jared
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jared Still INET: jkstill_at_cybcon.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Wed Jun 06 2001 - 22:45:18 CDT
![]() |
![]() |