KSH to find a ORA error in a log file


View Poll Results: Which Shell is more powerfull or most used.
KSH 1 100.00%
BASH 0 0%
Voters: 1. This poll is closed

 
Thread Tools Search this Thread
Operating Systems HP-UX KSH to find a ORA error in a log file
# 1  
Old 04-12-2008
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
# 2  
Old 04-12-2008
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 07:04 AM..
# 3  
Old 04-14-2008
Bug

Thanks - Jim Smilie

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
# 4  
Old 04-14-2008
I do not see the need for such a poll. Closing the poll.
# 5  
Old 04-14-2008
Your requirement used a file spec: *.log_fail - see code change above
# 6  
Old 04-28-2008
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
# 7  
Old 04-28-2008
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Ora-27603:ora-27626:

Hi, User claim that job is running slow from their end. I DBA found in database the below errors in alert log file. ORA-27603: Cell storage I/O error, I/O failed on disk o/192.168.10.3/RECO_DM01_CD_01_drm01 at offset 13335789568 for data length 1048576 ORA-27626: Exadata error: 2201 (IO... (2 Replies)
Discussion started by: Maddy123
2 Replies

2. AIX

I cannot find dsn and TNSNAMES.ora on UNIX

Where can I find dsn and TNSNAMES.ora on UNIX AIX Thanks for contribution (3 Replies)
Discussion started by: digioleg54
3 Replies

3. Shell Programming and Scripting

ksh - find command with 2 actions attached and error logging

Hi there, I'm encountering problems on an AIX system when using following in my script. find . -name *.edi -type f -exec sh -c 'scp {} $user@$server:$path || exit 5; mv {} $sent || exit 7' \; the error i get is following find: 0652-018 An expression term lacks a required... (4 Replies)
Discussion started by: Kerberos
4 Replies

4. HP-UX

ORA-27300 error because of hp ux

Dear All, i am not able to start the 9i oracle database because of the following problems. I log in into unix and then into sqlplus export oracle_sid=SATEST startup nomount i am getting the following errors ORA-27300: OS system dependent operation:semget failed with... (3 Replies)
Discussion started by: alokpattar
3 Replies

5. UNIX for Advanced & Expert Users

grep all ORA errors except one ORA error

Hi - I am trying to grep all "ORA" errors in a log files.I have to grep all ORA errors except one error for example ORA-01653.How can exclude that error in "grep" command? In following "grep" command I want to exclude "ORA-01653" error grep -i ORA alert.log >>/tmp/ora_errors.txt ... (7 Replies)
Discussion started by: Mansoor8810
7 Replies

6. Solaris

maxuprc and maxusers - ORA-27300, ORA-27301, ORA-27302

Hi all, Am intermittently getting the following errors on one of my databases. Errors in file /oracle/HRD/saptrace/background/hrd_psp0_13943.trc: ORA-27300: OS system dependent operation:fork failed with status: 12 ORA-27301: OS failure message: Not enough space ORA-27302:... (1 Reply)
Discussion started by: newbie_01
1 Replies

7. Shell Programming and Scripting

ORA-01756 Error while inserting a file in CLOB field

Hi, Please guide me where i am doing wrong, i am getting ORA-01756:quoted string not properly terminated when i am trying to insert file into CLOB cloumn of Oracle DB. Please find below the code where log file variable is myLogFile. Please let me know where i am doing wrong. ... (0 Replies)
Discussion started by: rajeshorpu
0 Replies

8. UNIX for Dummies Questions & Answers

find tnsnames.ora in unix

Can we find out what is the location of tnsnames.ora file used by the hp unix. (3 Replies)
Discussion started by: Sudipshib
3 Replies

9. Shell Programming and Scripting

how to find file time using ksh

Hi , i need to extract only time for a file and i am using following code for this.. while read record1 do SQLQuery=`echo $Record1 | awk '{printf $0 }'` InputfileName=`echo $Record1 | awk '{printf $8 }'` ColumnNamesSPcomma=`echo $Record1 | awk '{printf $4 }'` filetime =`echo... (6 Replies)
Discussion started by: manmeet
6 Replies

10. UNIX for Dummies Questions & Answers

Shell Script --- Delete ORA error from data file

Hi All, I have to make the following changes in shell script: When the data file is being created, an “ORA” error occurs in it. I have to remove this ORA error from data file and put it in log file. I am “ -n grip command” to find the ORA error and get the line number, How do I delete it... (1 Reply)
Discussion started by: sk005
1 Replies
Login or Register to Ask a Question