Consultor Eletrônico



Kbase P19181: How to disconnect all users from database without shutdown ?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/03/2003
Status: Unverified

GOAL:

How to disconnect all users from database without shutdown ?

FACT(s) (Environment):

UNIX

FIX:

#!/bin/sh
for i in `proshut dbname -C LIST | awk '{ print $1 }' | grep -v usr`
do
echo "Disconnecting usr num: " ${i} " ..."
proshut dbname -C disconnect ${i}
done

Please note: this will disconnect ALL users, including apw, biw, wdog, fmagent, replagent (if they are running), this can be avoided by puting grep -v wdog | grep -v ... before awk), ie for i in `proshut s -C LIST | grep -v wdog | awk .... You can setup your own "filter" this way as well.