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 -> Disconnect connected sessions

Disconnect connected sessions

From: Yuri Weinstein \(HotMail\) <yuriw_at_hotmail.com>
Date: Thu, 17 Apr 2003 20:15:29 GMT
Message-ID: <BXDna.139$Qj7.129@newssvr16.news.prodigy.com>


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

# Parameters
# $1 = username
# $2 = password
# $3 = tablespace
# $4 = sid
# $5 = dba username
# $6 = dba password

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


Received on Thu Apr 17 2003 - 15:15:29 CDT

Original text of this message

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