User Tools

Site Tools


recent_errors_in_database_alert_log

This is an old revision of the document!


Recent_errors_in_database_alert_log

#!/bin/ksh printf “Enter Destination File: ” read dest files=“/*/u??/oradata/$ORACLE_SID/oralogs -name alert_$ORACLE_SID.log” for file in $(find $files) do

   DT=$(date)
   awk '
   BEGIN {Flg=0}
   NR==1 {
       R=split(DATE,TMP," ")
       Day=TMP[[1]]
       Month=TMP[[2]]
       NoDay=TMP[[3]]
   }
   {NoDayM=NoDay-1}
   NF==5 && $2==Month && ($3==(NoDayM) || $3==(NoDayM)) {Flg=1}
   Flg==1 {print $0}
   ' DATE="$DT" $file | awk '
   /^ORA-/ || /cannot/ {print DATE print $0}
   NF==5 {DATE=$0}
   ' >> $dest

done exit 0

recent_errors_in_database_alert_log.1544273361.txt.gz · Last modified: 2018/12/08 12:49 by 0.0.0.0

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki