Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Purging alert log files
Kline.Michael schrieb:
> Also, I’m thinking there is a strong possibility that we could lose data
> on this. I’ve seen it sometimes take 5-15 seconds just to tail the alert
> log.
>
>
>
> Currently:
>
> cp $LOG_NAME $LOG_NAME.prev
>
> /usr/bin/gzip -c $LOG_NAME.prev >
> $ORA_LOG/$ORACLE_SID"_"$LOG_NAME"_"`date +%H:%M_%d-%h-%Y`.gz
>
> cat /dev/null > $LOG_NAME
>
>
>
> Maybe should:
>
> cp $LOG_NAME $LOG_NAME.prev
>
> cat /dev/null > $LOG_NAME
>
> /usr/bin/gzip -c $LOG_NAME.prev >
> $ORA_LOG/$ORACLE_SID"_"$LOG_NAME"_"`date +%H:%M_%d-%h-%Y`.gz
why do you copy the alert.log? i just rename it. rename is atomic, so no data loss possible. oracle will create a new alert.log if there's no such file.
regards,
-ap
-- Andreas Piesk a.piesk_at_gmx.net -- http://www.freelists.org/webpage/oracle-lReceived on Mon Jan 22 2007 - 10:46:00 CST
![]() |
![]() |