oracle11 logs, the sequel.

From: Mladen Gogala <mgogala_at_yahoo.com>
Date: 15 Jan 2008 14:58:18 GMT
Message-ID: <478cca09$0$1341$834e42db@reader.greatnowhere.com>


Oracle RDBMS 11.1.0.6 maintains XML version of alert_$ORACLE_SID.log, in addition to the ASCII one. Some of you might remember that log files are inclined to grow. To prevent endless growth which would fill up my disk space, I use logadm on Solaris and logrotate on Linux. I can do that on the ASCII version only because it doesn't have any kind of an internal structure. The award winning question is what to do about the XML version? If I let logrotate cut it weekly, I will end up with a useless XML file which I cannot validate or parse. It will require a manual intervention to make it into a proper XML file again. On the other hand, if I don't cut it with logrotate, it will grow like a sequoia in a vase, with similar consequences.
The award winning question is what to do about that? How can I slice & dice the log.xml file while preserving its usefulness? This file is extremely useful because it contains the exact timestamp for every message. An entry looks like this:

<msg time='2008-01-14T22:01:40.698+01:00' org_id='oracle' comp_id='rdbms'
 client_id='' type='UNKNOWN' level='16'
 module='' pid='25495'>
 <txt>Thread 1 advanced to log sequence 535  </txt>
</msg>

That provides, timestamp, component and message text, for every message.

--
Mladen Gogala
http://mgogala.freehostia.com
Received on Tue Jan 15 2008 - 08:58:18 CST

Original text of this message