« Converting timestamp to char | Home | Invalid objects in Oracle DB (health check) »
Search for Oracle errors in the alert log
Search for Oracle errors in the last $NUM lines.
NUM=1000
SIGNAL_LIST='^(...-|Error|Starting.*instance)|terminating instance'
SIGNAL_LIST='^(...-|Error|Starting.*instance)|terminating instance'
tail -$NUM alert_${ORACLE_SID}.log | awk '
BEGIN {prev="" ; ret=1 }
/'"$SIGNAL_LIST"'/ { if ( prev !~ /'"$SIGNAL_LIST"'/ ) { print "" ; print prev;} print $0;ret=0}
{prev=$0}
END { exit ret } '
On Unix Oracle alert log is normally located in bdump/alert_${ORACLE_SID}.log
Topics: Oracle, Unix Shell, awk, error, log | Submitter: checkthis
Comments
You must be logged in to post a comment.