The UNIX and Linux Forums  

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


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

View Poll Results: Which Shell is more powerfull or most used.
KSH 1 100.00%
BASH 0 0%
Voters: 1. You may not vote on this poll

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script Error: 13192.sumr: 0403-016 Cannot find or open the file. jgruenwald Shell Programming and Scripting 0 01-21-2008 08:08 AM
find error ust Shell Programming and Scripting 1 01-14-2008 04:46 AM
Error Message: find: cannot open /: Stale NFS file handle ezsurf SUN Solaris 1 10-11-2007 05:04 PM
I want to get the file which created the error when the find command was run guhas Shell Programming and Scripting 1 10-21-2005 12:06 PM
getting error 0403-016 Cannot find or open the file while reading a long line karthee Shell Programming and Scripting 2 06-04-2005 09:00 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-11-2008
techbravo's Avatar
Registered User
 

Join Date: Mar 2008
Posts: 12
Stumble this Post!
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
  #2 (permalink)  
Old 04-12-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,849
Stumble this Post!
Code:
echo " file name \c"
read filename
grep 'ORA-12545' $filename |\
while read result
do
        IFS=: && echo "$result" | read filename message
        echo "File: $file $message  Please contact DBA"
done

Last edited by jim mcnamara; 04-14-2008 at 03:04 AM.
Reply With Quote
  #3 (permalink)  
Old 04-14-2008
techbravo's Avatar
Registered User
 

Join Date: Mar 2008
Posts: 12
Stumble this Post!
Smile

Thanks - Jim

i tried running this script but is not returning any out put
it didnt ask me for a file name eather so that could be processed.

awating reply ..!!

thankz - techbravo
Reply With Quote
  #4 (permalink)  
Old 04-14-2008
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,661
Stumble this Post!
I do not see the need for such a poll. Closing the poll.
Reply With Quote
  #5 (permalink)  
Old 04-14-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,849
Stumble this Post!
Your requirement used a file spec: *.log_fail - see code change above
Reply With Quote
  #6 (permalink)  
Old 04-28-2008
techbravo's Avatar
Registered User
 

Join Date: Mar 2008
Posts: 12
Stumble this Post!
hi jim ,


i tried running that script after replacing the string with filename.Log_fail*
it takes the file name then it read the script but didnt echo anything actully..... it didnt echo anything , i think it have to add else statment in it ...... that says no error found .


thnz
techbravo
Reply With Quote
  #7 (permalink)  
Old 04-28-2008
Cameron's Avatar
Registered User
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 486
Stumble this Post!
FYI ... ORA-12545: Connect failed because target host or object does not exist

Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:30 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0