Hi All,
I need to get current error messages with time from alert.log.Below is my shell script but it's not working to meet this objective.
could anyone pls share on the above issue for resolution:
####################################################################
## ckalertlog.sh ##
####################################################################
#! /usr/bin/ksh
export DBALIST="xyz@rediffmail.com"
export ORACLE_HOME=some value
export SID=ORCL
cd $ORACLE_HOME/admin/bdump
if [ -f alert_${SID}.log ]
then
cp alert_${SID}.log alert_work.log
cat alert_work.log >> alert_${SID}.hist
grep ORA- alert_work.log | tail -100 > alert.err
fi
if [ `cat alert.err|wc -l` -gt 0 ]
then
echo "`date`" | mailx -s "${SID} ORACLE ALERT ERRORS as on `date`" $DBALIST < alert.err
fi
rm -f alert.err
rm -f alert_work.log
rm alert_ORCL.hist
Thanks for your time!!
Regards,