Well, not mine, but a recent post on the oracle-l mailing list which I thought was worth linking to and repeating. Firstly, because it’s interesting, and secondly, because it shows some good problem solving skills by both the poster and the wider Oracle community. The poster in question was experiencing a problem whereby his alert log was not updating…
We have an alert.log that was last updated by the database on May 6th.
Strangely enough, the log.xml in the alert directory of the diag destination
is being updated normally, it is just the plain text alert.log in the trace
directory that is not updated. We have bounced the database, changed the
diag_destination parameter and I have even grepped all the file descriptors
in /proc/*/fd for traces of a possibly opened alert.log - nothing, the alert.log
is still not being updated. I tried dbms_system.ksdwrt to force a write to
the alert.log - again, the log.xml is updated, the plain text is not.
The solution, it turns out, was quite surprising. There was a copy of the alert.log in the $ORACLE_HOME/dbs directory. This is the default directory for all things Oracle (try creating a datafile without specifying a full path and it will end up in there). When Oracle spotted the alert.log in the $OH/dbs directory it immediately assumed that it was the correct one and ignore the initialisation parameters. Strange behaviour and not one that I’ve ever seen before. However, I have seen similar issues with the tnsnames.ora. There are several locations that Oracle will look in to find the tnsnames.ora by default (e.g. /etc!). If it finds one, it stops looking in the other locations…   A more common reason for Oracle not writing to the alert log is that someone deleted with the database still running it. On Linux, if you delete a file with a file handle open it will remove the file but the file handle stays open and the program will continue to write to the file handle. If you need to remove a file in this situation, copy it (cp -p alert.log alert.log.sav) and overwrite the original file (cat /dev/null > alert.log) so both the file and the file handle remain valid.

2 responses to “My alert.log is broken”

  1. Sandesh Avatar
    Sandesh

    Ok, here is another puzzling one! I came across your post above, and checked the $ORACLE_HOME/dbs and did not find any alert log file there! Now what?!

    Like

    1. Neil Chandler Avatar

      The main point of this (old) post is that it is surprising to find an alert log in $ORACLE_HOME/dbs

      The actual location will vary in different releases, and there are 2 alert logs written; the xml files in the DIAG dest and the alert*.log in the “trace” directory.

      Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.