The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 04-11-2008
techbravo's Avatar
techbravo techbravo is offline
Registered User
 

Join Date: Mar 2008
Posts: 12
KSH to find a ORA error in a log file

Hi:

i have writen a script that needs a finishing
Pourpouse is to find a particular error in a file after we enter file name
and the return msg would describe if >there is a error -> "Contact DBA"
if there is no oracle error ->"No ora error found."

for the same i have written a script but finding hard to how to write this script --- Following is the script
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

#!/usr/bin/sh

echo This script will read the failed log file , and will echo the Oracle error message if it
echo is ther in the log file, for the same please contact the DBA-Support group
#
"A"="File name"
"B"="ORA-12545"
ls -ltr *.log_fail |grep ORA-12545 |head -10
#
if [grep"$A"= "$B"];then
echo "ORA ERROR FOUND"
else
echo "NO ORA ERROR FOUND"
fi
Reply With Quote
Forum Sponsor