今天在测试脚本的时候发现一个告警信息:
[oracle@RACDB01 scripts]$ ./sendmail.sh
上次行数:11813
本次行数:11833
检测到错误,发邮件
SP2-0103: Nothing in SQL buffer to run. SP2-0103: Nothing in SQL buffer to run. SP2-0103: Nothing in SQL buffer to run. SP2-0103: Nothing in SQL buffer to run. SP2-0103: Nothing in SQL buffer to run. PL/SQL procedure successfully completed.
虽然,存储过程也能执行成功,但是看到这样的消息总感觉怪怪的。
检查脚本,发现shell中调用sqlplus的地方,有注释的地方:
原来shell:
......
echo "检测到错误,发邮件"
#cat ./mailinfo|mutt -s "192.168 alert中出现ORA错误,请检查" $mail_list
result=`sqlplus -S system/admin < //execute send_mail('$mail_list','192.168.66.10 racdb1+$mailflag','$mailcontent');
exec PROCSENDEMAIL('$mailcontent','$ip_address $oraclesid $mailflag','test01@tinghai .org','oracle@tinghai.com',' 192.168.66.9 ',25,1,'test01','111111','/home/oracle/scripts/error.txt','bit 7');
exit
EOF`
echo $result;
......
调整后shell:
......
echo "检测到错误,发邮件"
#cat ./mailinfo|mutt -s "192.168 alert中出现ORA错误,请检查" $mail_list
result=`sqlplus -S system/admin < exec PROCSENDEMAIL('$mailcontent','$ip_address $oraclesid $mailflag','test01@tinghai.org','oracle@tinghai.com',' 192.168.66.9',25,1,'test01','111111','/home/oracle/scripts/error.txt','bit 7');
exit
EOF`
echo $result;
......
去掉注释行,执行不再提示告警。
[oracle@RACDB01 scripts]$ ./sendmail.sh
上次行数:11813
本次行数:11833
检测到错误,发邮件
PL/SQL procedure successfully completed.
[oracle@RACDB01 scripts]$ ./sendmail.sh
上次行数:11813
本次行数:11833
检测到错误,发邮件
SP2-0103: Nothing in SQL buffer to run. SP2-0103: Nothing in SQL buffer to run. SP2-0103: Nothing in SQL buffer to run. SP2-0103: Nothing in SQL buffer to run. SP2-0103: Nothing in SQL buffer to run. PL/SQL procedure successfully completed.
虽然,存储过程也能执行成功,但是看到这样的消息总感觉怪怪的。
检查脚本,发现shell中调用sqlplus的地方,有注释的地方:
原来shell:
......
echo "检测到错误,发邮件"
#cat ./mailinfo|mutt -s "192.168 alert中出现ORA错误,请检查" $mail_list
result=`sqlplus -S system/admin < //execute send_mail('$mail_list','192.168.66.10 racdb1+$mailflag','$mailcontent');
exec PROCSENDEMAIL('$mailcontent','$ip_address $oraclesid $mailflag','test01@tinghai .org','oracle@tinghai.com',' 192.168.66.9 ',25,1,'test01','111111','/home/oracle/scripts/error.txt','bit 7');
exit
EOF`
echo $result;
......
调整后shell:
......
echo "检测到错误,发邮件"
#cat ./mailinfo|mutt -s "192.168 alert中出现ORA错误,请检查" $mail_list
result=`sqlplus -S system/admin < exec PROCSENDEMAIL('$mailcontent','$ip_address $oraclesid $mailflag','test01@tinghai.org','oracle@tinghai.com',' 192.168.66.9',25,1,'test01','111111','/home/oracle/scripts/error.txt','bit 7');
exit
EOF`
echo $result;
......
去掉注释行,执行不再提示告警。
[oracle@RACDB01 scripts]$ ./sendmail.sh
上次行数:11813
本次行数:11833
检测到错误,发邮件
PL/SQL procedure successfully completed.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/751371/viewspace-1064164/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/751371/viewspace-1064164/