#
#  This script takes the ORACLE alert log file as an input to
#  create a compact list of dates and times, when ORACLE was  
#  started and shut down. It may need a little modification,
#  since ORACLE's alert log changes from version to version a
#  little. 
#
cat /oracle/???/saptrace/background/alert_???.log| awk \
'BEGIN {A="N";B="N";C="N"} {if($1=="DB06" && A=="N"){A="Y"}} \
{if($1!="DB06" && A=="Y"){print "+",$0;A="N"}} \
{if($5=="normal" && B=="N"){B="Y"}} \
{if($5!="normal" && B=="Y"){print "-",$0;B="N"}} \
{if($5=="NORMAL" && $4=="CLOSE" && C=="N"){C="Y"}} \
{if($5!="NORMAL" && $4!="CLOSE" && C=="Y"){print "-",$0;C="N"}}'