Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: diconnect all user at specific time
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