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: Killing user sessions within procedure

Re: Killing user sessions within procedure

From: Stephane Faroult <sfaroult_at_oriolecorp.com>
Date: Mon, 22 Mar 1999 21:24:19 -0800
Message-ID: <36F72583.1C7C@oriolecorp.com>


steve_mundie_at_my-dejanews.com wrote:
>
> I'm trying to remove (programatically) all users of an instance without
> shutting it down.
>
> Using a script to write a script then executing that script is possible but
> I'd like to have as little ineraction with the operating system as possible.
>
> I have a procedure which builds up "alter system kill session 'a,b' " strings
> then uses dbms_sql.parse() to execute it but I can't kill sessions with
> it. Similar code does drop tables successfully.
>
> Has anyone done this or is it only DDL you can run using the dbms_sql.parse()
> technique?

I don't know about any restriction (except perhaps some ALTER DATABASE commands) with the DBMS_SQL package. What do you mean by 'I can't kill sessions'? Any error message? Beware, because quite often killed sessions still appear in V$SESSION - but their status is set to KILLED. If you just look for current sessions, you may overlook the fact. What you could do too is to run your procedure as SYS (or after a CONNECT INTERNAL) if this is not already the case. As you know, all DBAs are equal, but SYS is more so and there is a number of things which are better done as SYS (beginners, forget about this sentence).

--
Regards,

  Stéphane Faroult
  Oriole Corporation



http://www.oriolecorp.com, designed by Oracle DBAs for Oracle DBAs
Received on Mon Mar 22 1999 - 23:24:19 CST

Original text of this message

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