我有一个shell脚本,它有以下命令:
LOGFILE=XX`date +%Y-%m-%d-%H:%M:%S`.log
LOG_PATH=`echo $CUR_DIR/$LOG_FILE`
echo "Creating Custom Package, Synonyms and Grants..."
echo "">>$LOGFILE
if sqlplus $APPS_USER @Alter_table_script.sql
then
echo "Custom table created successfully in APPS schema" "">>$LOGFILE
echo "Custom table created successfully in APPS schema"
else
echo "Error in creating custom table in APPS schema" "">>$LOGFILE
echo "Error in creating Custom table in APPS schema"
fi
Alter_table_script是一个带有alter和create语句的sql文件。现在很少有语句失败,但在日志中我没有确切的错误和捕获的行而是显示Custom table created successfully in APPS schema
如何捕获此文件中的确切错误?