#!/bin/bash
SID=my7g
DBAMAIL=xxx@126.com
cd $ORACLE_BASE/admin/${SID}/bdump
if [ -f alert_${SID}.log ]
then
mv alert_${SID}.log alert_work.log
touch alert_${SID}.log
cat alert_work.log>>alert_${SID}.hist
grep -i ORA- alert_work.log>alert.err
fi
if [ `cat alert.err|wc -l` -gt 0 ]
then
mutt -s "${SID} ORACLE ALERT ERRORS" $DBMAIL fi
rm -rf alert.err
rm -rf alert_work.log
SID=my7g
DBAMAIL=xxx@126.com
cd $ORACLE_BASE/admin/${SID}/bdump
if [ -f alert_${SID}.log ]
then
mv alert_${SID}.log alert_work.log
touch alert_${SID}.log
cat alert_work.log>>alert_${SID}.hist
grep -i ORA- alert_work.log>alert.err
fi
if [ `cat alert.err|wc -l` -gt 0 ]
then
mutt -s "${SID} ORACLE ALERT ERRORS" $DBMAIL fi
rm -rf alert.err
rm -rf alert_work.log
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16566331/viewspace-670102/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/16566331/viewspace-670102/