Beginning with Oracle Database 11g, the alert log is written as both an XML-formatted file and as a text file. You can view either format of the file with any text editor, or you can run an ADRCI command to view the XML-formatted alert log with the XML tags omitted. By default, ADRCI displays the alert log in your default editor. You can use the SET
EDITOR
command to change your default editor.
To view the alert log with ADRCI:
The following are variations on the SHOW
ALERT
command:
SHOW ALERT -TAIL
This displays the last portion of the alert log (the last 10 entries) in your terminal session.
SHOW ALERT -TAIL 50
This displays the last 50 entries in the alert log in your terminal session.
SHOW ALERT -TAIL -F
This displays the last 10 entries in the alert log, and then waits for more messages to arrive in the alert log. As each message arrives, it is appended to the display. This command enables you to perform live monitoring of the alert log. Press CTRL+C to stop waiting and return to the ADRCI prompt.
SPOOL /home/steve/MYALERT.LOG SHOW ALERT -TERM SPOOL OFF
This outputs the alert log, without XML tags, to the file /home/steve/MYALERT.LOG
.
SHOW ALERT -P "MESSAGE_TEXT LIKE '%ORA-600%'"
This displays only alert log messages that contain the string 'ORA-600'. The output looks something like this:
ADR Home = /u01/app/oracle/product/11.1.0/db_1/log/diag/rdbms/orclbi/orclbi: ****************************************************************************** 01-SEP-06 09.17.44.849000000 PM -07:00 AlertMsg1: ORA-600 dbgris01, addr=0xa9876541
Oracle Database Administrator's Guide for instructions for viewing the alert log with Oracle Enterprise Manager or with a text editor