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: diconnect all user at specific time

Re: diconnect all user at specific time

From: Sybrand Bakker <oradba_at_sybrandb.demon.nl>
Date: Thu, 22 Nov 2001 19:17:25 +0100
Message-ID: <f6gqvt0iah1cts3jbj4n8rec1bdm3k9uqb@4ax.com>


On Thu, 22 Nov 2001 16:30:02 +0100, "Andre Doehn" <a.doehn_at_gmx.net> wrote:

>hi,
>i have to import a oracle dump from a another db every night - but
>for dropping the old schema i have to disconnect all users with this
>username.
>how to disconnect with this specific username?
>
>i dont want to use this way:
>
>>select username, sid, serial# from v$session
>>where username = 'X';
>>
>>(this will give you the information you need to use in the next command to
>>kill the session.)
>>
>>then do
>>
>>alter system kill session 'sid,serial#'; where you replace sid and serial#
>>from the above query.
>
>....because after the system kill session command the session is marked as
>"killed" and
>hold up resources and locks forever until the instance is shut down.
>
>any way around this?
>
>thanks!
>
>andre
>

select username, sid, serial#, spid, 'kill -9 '||spid unixcmd ,'orakill '||spid ntcmd
 from v$session s, v$process p
where username = 'X'
and p.addr = s.paddr
/

Hth

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Thu Nov 22 2001 - 12:17:25 CST

Original text of this message

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