Sunday, January 18, 2015

Viewing the Alert Log

You can view the alert log with a text editor, with Enterprise Manager, or with the ADRCI utility.
To view the alert log with Enterprise Manager:
1.      Access the Database Home page in Enterprise Manager.
2.      Under Related Links, click Alert Log Contents.
The View Alert Log Contents page appears.
3.      Select the number of entries to view, and then click Go.
To view the alert log with a text editor:
1.      Connect to the database with SQL*Plus or another query tool, such as SQL Developer.
2.      Query the V$DIAG_INFO view
SELECT * FROM V$DIAG_INFO;

INST_ID NAME                  VALUE
------- --------------------- -------------------------------------------------------------
      1 Diag Enabled          TRUE
      1 ADR Base              /u01/oracle
      1 ADR Home              /u01/oracle/diag/rdbms/orclbi/orclbi
      1 Diag Trace            /u01/oracle/diag/rdbms/orclbi/orclbi/trace (txt log file)
      1 Diag Alert            /u01/oracle/diag/rdbms/orclbi/orclbi/alert (xml file)
      1 Diag Incident         /u01/oracle/diag/rdbms/orclbi/orclbi/incident
      1 Diag Cdump            /u01/oracle/diag/rdbms/orclbi/orclbi/cdump
      1 Health Monitor        /u01/oracle/diag/rdbms/orclbi/orclbi/hm
      1 Default Trace File    /u01/oracle/diag/rdbms/orclbi/orclbi/trace/orcl_ora_22769.trc
      1 Active Problem Count  8
      1 Active Incident Count 20
3.      To view the text-only alert log, without the XML tags, complete these steps:
a.       In the V$DIAG_INFO query results, note the path that corresponds to the Diag Trace entry, and open the directory to that path.
b.      Open file alert_SID.log with a text editor.
4.      To view the XML-formatted alert log, complete these steps:
a.       In the V$DIAG_INFO query results, note the path that corresponds to the Diag Alert entry, and change directory to that path.
b.      Open the file log.xml with a text editor.
To view the alert log with ADRCI in interactive mode:
1.       Start ADRCI in interactive mode.
·         Ensure that the ORACLE_HOEM and PATH environment variables are set properly
·         The PATH environment variable must include ORACLE_HOME/bin.
·         Open the command prompt ADRCI
·         TYPE SHOW ALERT
·         Select the option and [ENTER]
2.       Exit the editor to return to the ADRCI command prompt.
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

No comments:

Post a Comment