SOME EASY TO USE TOOLS

SOME EASY TO USE TOOLS

SOME EASY TO USE TOOLS

#!/usr/bin/ksh

# source the database instance to be monitored like ORACLE_SID, ORACLE_BASE, ORACLE_HOME ... saved by you to a .profile

$ORACLE_HOME/bin/sqlplus "/ as sysdba" << eof>  set trim on set trims on set verify off spool $ORACLE_BASE/log/errors.log select distinct originating_timestamp, message_text from x$dbgalertext where (originating_timestamp >= sysdate-120/1440)

Lightshot screenshot

spool off
eof
exit

ErrCnt=`cat $ORACLE_BASE/log/errors.log |grep "no rows selected"| wc -l`

if [[ $ErrCnt == "1" ]]
then
echo "we are good"
else
uuencode $ORACLE_BASE/log/errors.log $ORACLE_BASE/log/errors.log|/usr/bin/mailx -s "$ORACLE_SID on $host has errors" "$MAIL"
fi