oracle数据库如何删除所有表数据,oracle删除存储过程语句
#! /bin/bash
#drop tablespace
if [ $# -ne 1 ]; 陈真
echo ' usage : $0tablespace _ name '
exit 1
fi
# configureoracleenv : aboutoracleenvs,用户名称和密码
ORACLE_SID=orcl
Oracle _ home=/u01/app/Oracle/product/11.2.0/db _ 1
ora _ data=/u01/app/Oracle/product/11.2.0/db _1/DBS /
ora_user='sys' #oracle username
ora _ pass=' password ' # Oracle用户密码
tablespace _ name=$ (echo $1| tr ([a-z] ) [ a-z ] ) ) ) )。
outfile tmp=/tmp/droptpstmp 01.txt # specifytheoutputfilelocation
设置关闭;
设置反馈关闭;
设置超时关闭;
set pagesize 0;
设置验证关闭;
设置Echo关闭;
spool ${outfiletmp}
select tablespace _ name from DBA _ tablespaceswheretablespace _ name=‘$ { tablespace _ name }‘;
Spool关闭
退出;
! 01
TPS _ jug=` grep-I $ { tablespace _ name } $ { outfile tmp } `
if [ ' $ { TPS _ jug } '=' $ { tablespace _ name } ]; 陈真
wind_var=$ (
设置关闭
DOP tablespace $ { tablespace _ name } includingcontentsanddatafiles;
退出;
echo -e '\e[1; 32m $ { wind _ var }\ehhddx ' # directdisplayreturnsresults
exit 1
else
echo -e '\e[1; 31m------------ehddx '
echo -e '\e[1; 31 mthe tablespace $ { tablespace _ name } notexits! \ehhddx '
echo -e '\e[1; 31m------------ehddx '
exit 1
fi
rm -rf ${outfiletmp}