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

Home -> Community -> Usenet -> c.d.o.server -> Re: Kill all user on 7.2 db

Re: Kill all user on 7.2 db

From: Cai Yi <ycai_at_hempseed.com>
Date: 1997/08/19
Message-ID: <33F96267.198910B5@hempseed.com>#1/1

Chuck Hamilton wrote:
>
> Oosterling_at_compuserve.com (Erik Oosterling) wrote:
>
> >Hello all,
> >
> >severall actions on my DB at the end of a day. But before that i want
> >to kill all the users who still have a session running. Is there a way
> >to do this or do i have to bring the Db down and up.
> >
> >PLease help me !
>
> You could write a script to do this but IMHO it's just as easy to
> bounce the DB. Do a 'shutdown immediate' followed by a 'startup'.

If you still want to kill user sessions manually, I can give you a sample that
I used to run before I turned to using 'shutdown immediate'.

Here it is:

set heading off termout off verify off echo off spool kill.sql
select 'alter system kill session ' || chr(39) || sid || ','

   || serial# || chr(39) || ';' from v$session where    username is not null and username <> 'SYS' and status='INACTIVE' /
spool off
start kill.sql

Regards,

-- 
   ___    __    ____          _  _  ____ 
  / __)  /__\  (_  _)        ( \/ )(_  _)
 ( (__  /(__)\  _)(_          \  /  _)(_ 
  \___)(__)(__)(____)         (__) (____)
Received on Tue Aug 19 1997 - 00:00:00 CDT

Original text of this message

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