Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: perl/shell script for alert log
When I grep something from the alert log,
it never tell me the date and time of the error.
Is there a setting for appending a timestamp on each error?
-----Original Message-----
Sent: Wednesday, August 27, 2003 1:35 PM
To: Multiple recipients of list ORACLE-L
HTH
#!/bin/sh
# This Script search for Oracle error messages in last
100 lines in the alert log file ,
# keep log to a file.
# You should pass name of ORACLE_SID as a parameter.
#!/usr/bin/sh
#
# Comments: Script checks last 100 lines of
# the alert log for specific
# Oracle errors, e-mails depending on the error.
# Parameter: ORACLE_SID
# -------------------
#
#------------------------------------------------
DIR=/u01/app/oracle/admin
ORACLE_SID=$1
export ORACLE_SID
ORACLE_HOME=/u01/app/oracle/product/8.1.7
export ORACLE_HOME
ALERT_DEST=/u01/app/oracle/admin/${ORACLE_SID}/bdump
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
PATH=$PATH:$ORACLE_HOME/bin
export PATH
COLLECTOR=`tail -100
$ALERT_DEST/alert_${ORACLE_SID}.log |grep "ORA-"`
if [ "$COLLECTOR" <> "" ]
then
echo ""
echo "******** Errors found in: ====>
$ALERT_DEST/alert_${ORACLE_SID}.log"
echo ""
echo $COLLECTOR
echo ""
fi;
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Jose Luis Delgado INET: joseluis_delgado_at_yahoo.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). For technical support please email tech_support_at_dp7uptx.com or you can call (972)721-8257. This email has been scanned for all viruses by the MessageLabs Email Security System. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Roger Xu INET: roger_xu_at_dp7uptx.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Wed Aug 27 2003 - 14:49:28 CDT
![]() |
![]() |