sqlplus jkadmin/jk123 @status.sql > s.txt
jjj=`cat s.txt|grep good`
echo $jjj
if [ $jjj = "statusgood" ];then
mail -s "OracleRAC136 OK." chinadba@139.com,master@bjepiao.com < s.txt
else
mail -s "OracleRAC136 error." chinadba@139.com,master@bjepiao.com < s.txt
fi
jjj=`cat s.txt|grep good`
echo $jjj
if [ $jjj = "statusgood" ];then
mail -s "OracleRAC136 OK." chinadba@139.com,master@bjepiao.com < s.txt
else
mail -s "OracleRAC136 error." chinadba@139.com,master@bjepiao.com < s.txt
fi
[root@clu2 oracle]# cat status.sql
set time on
set timing on
set autotrace on
select * from jktab;
quit
set time on
set timing on
set autotrace on
select * from jktab;
quit
本文转自 jxwpx 51CTO博客,原文链接:http://blog.51cto.com/jxwpx/228554,如需转载请自行联系原作者