批量删除oracle用户表空间
1.[代码][Shell/批处理]代码
#!/bin/bash
# get cuttent path
selfpath=$(cd "$(dirname "$0")"; pwd)
echo "current path" $selfpath
echo "Warning : File path is best not to have Chinese !"
echo "Is going on ? [y/n]"
read YES_OR_NO
if [ "$YES_OR_NO" != "y" ]; then
echo "Good bye!"
exit 1
else
echo drop user
sqlplus system/system@bip_oracle_design @$selfpath/drop_user_design.sql
echo drop tablespace
sqlplus system/system@bip_oracle_design @$selfpath/drop_tablespace_design.sql
echo delete dbf file
rm -r /export/home1/oracle/enzymedata/enzyme/design/bip_ts_design.dbf
rm -r /export/home1/oracle/enzymedata/enzyme/design/esap_default_design.dbf
rm -r /export/home1/oracle/enzymedata/enzyme/design/report_ts_design.dbf
rm -r /export/home1/oracle/enzymedata/enzyme/design/workflow_ts_design.dbf
rm -r /export/home1/oracle/enzymedata/enzyme/design/portal_ts_design.dbf
echo delete success
echo "The End"
fi
exit 0