Shell脚本调用Oralce数据库SQL文生产日志

#!/bin/sh
export LANG="zh.CN.GBK"
echo -n "********************************************"
if [ "\$#" -ne "1" ]
then
 echo "Error ,you should give the fileName"
else
sqlpath=/home/oracle/update/updatesql/\${1}
logpath=/home/oracle/update/updatelog/\${1}
sqlplus */* < \$sqlpath > \$logpath
echo "sqlplus */* < \$sqlpath > \$logpath"
echo ------------\${1} start ----------------
cat \$logpath
echo ------------\${1}  end  ----------------
fi
date=`date +%Y%m%d`
mkdir -p /home/oracle/update/updatesql/bak/\$date
mv /home/oracle/update/updatesql/\${1} /home/oracle/update/updatesql/bak/\$date

posted @ 2018-01-17 15:49  FlyBack  阅读(207)  评论(0编辑  收藏  举报