Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Script to check for errors

RE: Script to check for errors

From: Eberhard, Jeff <Jeff.Eberhard_at_Rolls-RoyceGS.com>
Date: Fri, 21 Mar 2003 12:32:32 -0700
Message-Id: <24738.322736@fatcity.com>


Here's what I use. Pretty basic (crappy) but may be a starting point for you. You'll have to go through and change where you alert files are stored and to whom to send the email. I schedule them to run about every 15 minutes. blat is a mail utility you can downloaded from the internet.      

HP-UX:  

if [ -s "ORAerr.tmp" ]
  then
    exit
fi
grep ORA- /u01/app/oracle/admin/orcl/bdump/alert_sid.log > ORAerr.tmp if [ -s "ORAerr.tmp" ]
  then
  cat crlf.txt /u01/app/oracle/ORAerr.tmp | /usr/sbin/sendmail
-CsendmailORA.cf
-F"Oracle dbsrv1 alert error" username @company.com
<mailto:username_at_company.com>
fi      

WINdoze:  

find "ORA-" c:\orant\rdbms80\trace\*ALRT.LOG* > e:\dbwork\alerts.txt if errorlevel 1 goto NEXT
rem net send dba "An ORACLE error has been found in the alert file. Please check the alerts.txt file on dbsrv2"
blat e:\dbwork\alerts.txt -t dba @company.com <mailto:dba_at_company.com> -s "Oracle (dbsrv2) alert"
:NEXT
find "ORA-" c:\orant\rdbms80\trace\orcl\*ALRT.LOG* > e:\dbwork\alertsorcl.txt
if errorlevel 1 goto END
rem net send dba "An ORACLE error has been found in the ORCL alert file. Please check the alerts.txt file on dbsrv2" blat e:\dbwork\alertsorcl.txt -t dba @company.com <mailto:dba_at_company.com>
-s "Oracle ORCL alert"

erase c:\orant\rdbms80\trace\orcl\orclalrt.tmp rename c:\orant\rdbms80\trace\orcl\orclalrt.log orclalrt.tmp :END  
-----Original Message-----

From: Michael Kline [mailto:mkline1_at_comcast.net] Sent: Friday, March 21, 2003 11:40 AM
To: Multiple recipients of list ORACLE-L Subject: Script to check for errors

Anyone have a "simple" script to scan an alert log for errors and email a report if found?  

Customer wants something to run "often", but only email when an error is found. I've got something that does a bit of that and runs twice a day, but Received on Fri Mar 21 2003 - 13:32:32 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US