Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Alert Log reporting question
>Hi all,
>
>I am writing a script that can "grep "ORA-" from
>alert log.
>
>I think it will be good if I can grep the time of
>the error occur, can you please help me?
>
>If you are lazy to type please introduce me any
>related unix function, I will do man "the function"
>myself.
>
>
>Thanks
>
>Sinardy
Sinardy,
I don't think that 'grep' is the tool to use, because it operates mainly line by line (at least this is the way I use it :-)) and the timestamp appears a variable number of lines before the error message. You need some 'short-term memory' to associate the error message to the latest timestamp encountered. I would use awk instead, unless you have a familiarity with perl which I haven't. Before you reinvent the wheel, check the Internet, I think that some tools, possibly some of them free, are available.
Regards,
Stephane Faroult
Oriole
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephane Faroult INET: sfaroult_at_oriolecorp.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Mon Feb 24 2003 - 03:28:43 CST