Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Auto-terminating idle sessions

Re: Auto-terminating idle sessions

From: Michel Cadot <micadot_at_netcourrier.com>
Date: 2000/06/22
Message-ID: <8isgm3$2hiv$1@s2.feed.news.oleane.net>#1/1

You can use user profile.

  1. Create a profile: create profile my_profile limit idle_time 10;
  2. Set the profile to the user: alter user my_user profile my_profile;
  3. Enable the enforcement of the resource limits
  4. add the following line in your init.ora file: resource_limit=true
  5. Shutdown and startup the database in Oracle v7 or alter system set resource_limit=true in Oracle8 or 8i
--
Have a nice day
Michel


Kenneth Tam <k2tam_at_ecexh.uwaterloo.ca> a écrit dans le message :
8irc0r$5f2$1_at_watserv3.uwaterloo.ca...

> How can I get Oracle to automatically terminate sessions based on some
> idle time parameter (for example, elapsed time since last call > 10 minutes,
> or something like that)?
>
> I would have expected there to be a configuration parameter I could set
> that determines the max lifetime of a session.. but there doesn't seem to
> be anything like that.
>
> My next thought was to have Oracle run a stored proc periodically to
> check for idle sessions, and kill 'em.. something like
>
> select sid,serial#,status,last_call_et from v$session where last_call_et >
> 600 and status='inactive'
>
> and calling 'alter system kill session' over the results.
>
> Of course, PL/SQL doesn't allow you to use 'alter system' (I can't see why
> not..), so that's out of the question.
>
> Now I'm going to try and write the same stored proc in Java, where
> presumably I can execute whatever the hell I like.
>
> But this all seems so complicated for what I would expect to be a fairly
> common requirement.
>
> In case it helps, here's some context: I'm writing a JDBC app that opens
> connections to an oracle server.. the problem is that it's not possible
> to guarantee that the app will properly shut down (someone might reboot
> the machine for example), so I can't guarantee that the oracle sessions
> will be closed by the app.
>
> thanks!
>
>
Received on Thu Jun 22 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US