The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


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


Other UNIX.COM Threads 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 Search this Thread Display Modes
  #1 (permalink)  
Old 04-11-2008
techbravo's Avatar
Registered User
 

Join Date: Mar 2008
Posts: 8
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl 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,228
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl 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: 8
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl 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,626
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl 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,228
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Your requirement used a file spec: *.log_fail - see code change above
Reply With Quote
Google UNIX.COM
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 02:55 AM.


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

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102