Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Disconnect connected sessions
Hi all,
I am using the script below to drop and re-create a user. However if somebody is connect this script would not work.
How would I disconnect all active sessions and make this script work?
Thx
YuriW
#! /bin/sh
if [ $# -ne 6 ]; then
echo 1>&2 Usage: "$0 <username> <password> <tablespace> <sid> <dba
username> <dba password>"
exit 1
fi
# XXX: Turned off grant of DBA privileges
# GRANT CONNECT, RESOURCE, DBA TO $1;
sqlplus $5/$6@$4 <<EOF
DROP USER $1 CASCADE;
CREATE USER $1 IDENTIFIED BY $2
DEFAULT TABLESPACE $3 TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT QUOTA UNLIMITED ON $3
QUOTA UNLIMITED ON TEMP ACCOUNT UNLOCK;
GRANT CONNECT, RESOURCE TO $1;
EOF
exit 0
![]() |
![]() |