Monday, October 10, 2011

Read alert log file in Oracle 11g

In Oracle 11g we have the possibility to read the alert log file directly from a X$ view.
This view can be read, only when connected with sysdba role.

Below sql will display the content of the alert log file for the current sysdate , however you can restrict the result set based on your needs:

select to_char(originating_timestamp, 'DD-MON-YYYY HH:MI:SS HH24') "TIME",
       MESSAGE_TEXT
from   X$DBGALERTEXT
where  to_char(originating_timestamp,'DD-MON-YYYY') = TO_CHAR(SYSDATE,'DD-MON-YYYY')
ORDER BY originating_timestamp ASC

No comments:

Post a Comment