Operating System - HP-UX
1843927 Members
1300 Online
110226 Solutions
New Discussion

Re: How to create formatted output from oracle database log file?

 
SOLVED
Go to solution
Kirill Cherkashin
Frequent Advisor

How to create formatted output from oracle database log file?

We have oracle standby database logs files. I'd like to create output file with next entries:

date name of file.

How I could accomplish this?
pls. find below typical output from log file:

ORA-00279: change 104641228 generated at 06/04/2002 22:41:24 needed for thread 1
ORA-00289: suggestion : /oradata/archive/36011.rdo
ORA-00280: change 104641228 for thread 1 is in sequence #36011
ORA-00278: log file '/oradata/archive/36010.rdo' no longer needed for this recovery
Log applied.
4 REPLIES 4
harry d brown jr
Honored Contributor

Re: How to create formatted output from oracle database log file?

In your example, do you want to log 36010 or 36011?

with awk or perl you can do this.

live free or die
harry
Live Free or Die
Kirill Cherkashin
Frequent Advisor

Re: How to create formatted output from oracle database log file?

The last one.
Graham Cameron_1
Honored Contributor
Solution

Re: How to create formatted output from oracle database log file?

In that case:
awk '
/^ORA-00279/ {dattim = $6 $7}
/^ORA-00278/ {print dattim, $4}
' < ALERT_FILENAME >> OUTPUT_FILENAME

Where
ALERT_FILENAME is the name of the 'log file' you describe
and
OUTPUT_FILENAME is the output file you want to create

- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Aashish Raj
Valued Contributor

Re: How to create formatted output from oracle database log file?

Hi, Instead of getting this info from the alert.log, you can also get this information from v$log_history view of standby database.
select sequence#,first_time from v$log_history;

hth
AR