From Toad :
We can use the below query :
SELECT 'DROP USER ' || USERNAME || ' CASCADE;' FROM DBA_USERS WHERE USER_ID>54
From OS we can use the below scripts :
script for Linux :
==================
[oracle@rptsvr ~]$ cat drop.sh
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
read -s -p "Enter username:" user
$ORACLE_HOME/bin/sqlplus sys/sys123 as sysdba << !
drop user $user cascade;
Script for AIX :
================
bash-3.00$ cat drop.sh
export ORACLE_HOME=/orafs/app/oracle/10.2.0/db_1
export ORACLE_SID=onlinete
echo "user1 please:\c"
read user1
echo "user2 please:\c"
read user2
$ORACLE_HOME/bin/sqlplus sys/sys123@onlinete as sysdba << !
drop user $user1 cascade;
drop user $user2 cascade;
No comments:
Post a Comment