Operating System - HP-UX
1753957 Members
7400 Online
108811 Solutions
New Discussion юеВ

How to grep all ORA messages but exclude ORA-1128 & 1140 ?

 
molo1
Occasional Contributor

How to grep all ORA messages but exclude ORA-1128 & 1140 ?

How to grep all ORA messages but exclude ORA-1128 and ORA-1140 ?

I have tried:

egrep "ALTER|-v SYSTEM" /... /alert.log > /.../output.log

but it didn't work.

Any idea?

3 REPLIES 3
Steven Schweda
Honored Contributor

Re: How to grep all ORA messages but exclude ORA-1128 & 1140 ?

> How to grep all ORA messages but exclude ORA-1128 and ORA-1140 ?

   It might help (some of us) if you posted a small excerpt of the file
with the messages in it.

Hans_c
Occasional Advisor

Re: How to grep all ORA messages but exclude ORA-1128 & 1140 ?

ORA-1128 and ORA-1140 aren't valid error codes.

Perhaps you mean ORA-01128 and ORA-01140?

If so, try this:

egrep -e ORA-01128 -e ORA-01140 location_and_name_of_your_alert_log >  output_filename

 

Dennis Handly
Acclaimed Contributor

Re: How to grep all ORA messages but exclude ORA-1128 & 1140 ?

> egrep "ALTER|-v SYSTEM" /... /alert.log > /.../output.log

 

No need for egrep.

You could use a two stage pipeline, where the first picks all and the second excludes:

grep "ALTER|-v SYSTEM" /... /alert.log | grep -v -e ORA-1128 -e ORA-1140 > /.../output.log