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

原文地址:https://www.cnblogs.com/flyback/p/8303315.html