XML Alert Log

By now everyone discovered the new alert log in 11g, XML format and all. For the 11g challenged, I’ll point at the new official way of viewing your alert log: Say hello to ADRCI and bye bye to vi, less, more, tail and grep. Except that I’m not saying bye to vi any time soon, I’m saying “VI, meet XML Alert log. I hope you two will be good friends and get along fine because you’ll be seeing each other a lot in the near future”.

When I tried to look at the XML alert log with an XML viewer, it turned out that the alert log (and listener log) are not XML documents at all. At least not well formed one. Well formed XML document should contain one root element which contains all other elements. Oracle logs contain many MSG elements, all at top level.

I also noticed that Oracle failed to release an xml schema, or any other document describing the format of the alert logs and would allow proper parsing of it (proper – not based on guesses and reverse engineering).

Also, it is interesting to note that each error message element contains many attributes, bloating the alert log to a worrying size. I really could live without knowing that every single message in my alert log was written by org_id=’oracle’. On the other hand, knowing the PID is nice. The fact that all this information is kept as attributes of MSG element and not as child elements should make it easier to keep related messages together when using XML PATH to get information out of the file.


4 Comments on “XML Alert Log”

  1. Micke says:

    For those of us who still likes to use the ‘old-style’ text-based alert log it is still available under the following directory:



  2. Micke says:

    …and the path should of course be :



  3. prodlife says:

    But that would be cheating! 🙂

  4. Hi Chen Shapira 😀
    The xml file has no closing tags, so you can tail -f your log as it is written in a write-append mode. Therefore the xml file is not an XML document but however it is a wellformed XML content.

    You probably should have a look on my post today
    alert log in xml format

    Have fun with X/ML

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s