You are on page 1of 18

Location of alert.

log file
Posted on: 11-19-2010 Posted in: Oracle Tips and Tricks The alert.log file contain messages related to the startup and running of a specific database.

The name of the alert.log file is:


alert<ORACLE_SID>.log

on Windows, or
alert_<ORACLE_SID>.log

On Unix/Linux The alert.log file normally is in the $ORACLE_BASE/<ORACLE_SID>/bdump location, or since Oracle 11g in the database specific location in the diagnostic_dest.

If the database is running, you can issue following select to be able to identify the location of the background_dump_dest:
SQL> select value from v$parameter where name='background_dump_dest'; VALUE ------------------------------------------------------------------------------/oracle/diag/diag/rdbms/ora11g/ORA11G/trace

To find the location of the diagnostic_dest, one can use the following select:
SQL> select value from v$parameter where name='diagnostic_dest'; VALUE ------------------------------------------------------------------------------/oracle/diag/

In order to know the current ORACLE_SID, you can use following select:
SQL> select name from v$database; NAME

--------------------------ORA11G

In our example, because we are on Linux, the name of the alert.log file will be:
/oracle/diag/diag/rdbms/ora11g/ORA11G/trace/alert_ORA11G.log

If the alert.log file is not in any of these locations, or the parameters are not set, the alert.log file will be in your %ORACLE_HOME/rdbms/trace directory.
#New directory for alert log #Oracle 8,9,10G Alert log /oracle/<SID>/saptrace/background/alert_<SID>.log /oracle/DEV/saptrace/background/alert_DEV.log #Oracle 11G Alert log /oracle/<SID>/saptrace/diag/rdbms/<sid>/<SID>/trace/alert_<SID>.log /oracle/DEV/saptrace/diag/rdbms/dev/DEV/trace/alert_DEV.log

#New directory for Listener log #Oracle 8,9,10G Listener log /oracle/<SID>/<VERSION 3Digit>_<BIT>/network/log/listener.log /oracle/DEV/817_32/network/log/listener.log /oracle/DEV/920_64/network/log/listener.log /oracle/DEV/102_64/network/log/listener.log #Oracle 11G Listener log /oracle/<SID>/saptrace/diag/tnslsnr/<server name>/listener/trace/listener.log /oracle/DEV/saptrace/diag/tnslsnr/sever1/listener/trace/listener.log

http://www.ora600.be/node/4530
How to check alert.log in Oracle 11g Virag Sharma virag123@gmail.com Oracle 11g introduce new tool/utility called ADRCI known as ADR command line tool. This tool allow user to interact with ADR ,check alert log, check health monitor(HM) status , Package incident and problem information into a zip file for send to Oracle Support. Etc. No username/password need to log in to ADRCI, ADRCI interact with file system and ADR data is secured only by operating system permissions on the ADR directories.

$adrci adrci> set editor vi adrci> show alert ( it will open alert in vi editor ) adrci> show alert -tail ( Similar to Unix tail command )

adrci> show alert -tail 200 ( Similar to Unix Command tail -200 ) adrci> show alert -tail -f ( Similar to Unix command tail -f ) adrci> show alert -tail 100 -f ( Similar to tail -100f )

Too list all the "ORA-" error run following command

$adrci adrci> show alert -P "MESSAGE_TEXT LIKE '%ORA-%'"<?xml:namespace prefix = o />

In 11g alert file is saved in 2 location, one is in alert directory ( in XML format log.xml ) and old style alert file in trace directory. Both these directory reside inside ADR HOME. ADR (Automatic Diagnostic Repository ) is a file system based directory structure outside of the database, So you can have access of diagnostic data even database is down.

New initialization parameter DIAGNOSTIC_DEST decide where to store ADR data ( i.e diagnostic data). In oracle 11g parameter background_dump_dest, core_dump_dest, user_dump_dest is replaced by DIAGNOSTIC_DEST. Even you set background_dump_dest, core_dump_dest, user_dump_dest it not going to used i.e. 11g ignore these parameters.

SQL> show parameter diagnostic_dest NAME TYPE VALUE --------------- --------------------------- ------------------------diagnostic_dest string /u01/app/oracle

More Oracle Database 11g New Features

1. 2. 3. 4.

Oracle SQL REPLAY

IPS ( Incident Packaging Service)

Automatic Diagnostic Repository (ADR) Database Replay [Click for Detail]

Oracle 11g Monitoring and Goodbye Alert Log!


Oracle 11g has introduced many new features for database monitoring and administration. This month, we will examine the new interface for monitoring database events within the Oracle 11g database release. In previous releases of Oracle database, there was the alert.log text based file that contains all database activity of use to the vigilant DBA. The alert.log file contains error messages and major database activities and operations which are monitored by the DBA as part of daily maintenance. However, this alert.log file disappears with Oracle 11g and is now replaced by an XML file called the log.xml file. Oracle 11g also introduces a new command line utility called the ADR Command Interface or ADRCI to review the contents of the log.xml file. By default, the ADR tool is located under the Oracle 11g directory ORACLE_BASE/diag/rdbms/SID/SID/alert . In order to use the ADR tool, the command adrci is issued with Oracle 11g.

Let's explore an example on how to use the new ADR command tool to view our new Oracle 11g diagnostic log contents. The default location where the log.xml file is located on the test Oracle 11g Red Hat Linux server in this example: /u01/app/oracle/diag/rdbms/ora11g/ORA11G/alert

Start a new session of ADR command tool by issue command adrci:

Now let's check out some of the cool new features of the ADR command tool. To display options with the help command from within ADRCI:

For extended help options we can use the help extended command from within the ADR command tool and shown below:

We can get detailed explanations of an option such as the BEGIN BACKUP command which will present a series of screens much like that found in the old UNIX man pages.

What you should finally realize at this point is that Oracle 11g has taken monitoring to a whole new level over 10g release. In fact, think of it as monitoring

on steroids. We will next view an example of how to look at the log files for database monitoring with Oracle 11g on Red Hat Linux.

Lets scroll down and see more options for the show alert option with ADRCI:

As you can see, there are now options to review the old style alert.log files as well

as the ability to view the log files from the Oracle listener and host. We can also parse the log file to see just a recent activity which is useful for quick monitoring tasks. Lets take a peek at one of the recent log files in the next example. We choose option 1 and the alert log file is displayed below:

By default the log files are stored under the Linux /tmp directory structure.

To exit and return to the main ADR command screen we use the :q command within the Linux vi editor.

The ADR command tool also lets us view the new health monitor reports and functions. For instance, if I wish to look at the most recent health monitor execution tasks then I can simply issue the show hm_run command within the ADR command

interface.

Also of note with Oracle 11g are several new V$ tables that correspond to the ADR and new health monitoring features: V$HM_CHECK V$HM_CHECK_PARAM V$HM_FINDING V$HM_INFO V$HM_RECOMMENDATION V$HM_RUN

Complete syntax and further details on the ADR command tool is available online in the Oracle 11g Documentation located here We have barely scratched the surface in how to use this potent new monitoring feature for Oracle 11g. Explore the power of the tool as it promised much needed

functionality and useful instrumentation for busy Oracle DBAs in monitoring of large and complex Oracle 11g environments. Regards, Ben

Oracle 11g alert log location


Oracle alert log contains much useful information about your Oracle database, but do you know where is it located and how could you find it out?

1. Connect to the database with SQL*Plus or another query tool, such as SQL Developer. 2. Query the V$DIAG_INFO view as shown in "Viewing ADR Locations with the V$DIAG_INFO View". 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 change 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.

Oracle 11g: Automatic Diagnostic Repository (ADR)


1. Some facts of ADR

First introduced in Oracle database 11g. The database, Automatic Storage Management (ASM), Cluster Ready Services (CRS), and other Oracle products or components store all diagnostic data in the ADR.

An advanced fault diagnosability infrastructure for collecting and managing diagnostic data A file-based repository stored outside the database, including the alert log, all trace files, dump files, core files, and other diagnostic data. Each instance of each product stores diagnostic data underneath its own ADR home directory.

2. ADR BASE: the ADR root directory, controlled by the Oracle "diagnostic_dest" parameter. The first subdirectory inside an ADR (under the <adr_base> directory) is always named "diag".

Any number of instances/components can share same ADR BASE. Under ADR BASE there will be individual ADR HOMES. DIAGNOSTIC_DEST o If environment variable ORACLE_BASE is set, DIAGNOSTIC_DEST is set to the directory designated by ORACLE_BASE. o If environment variable ORACLE_BASE is not set, DIAGNOSTIC_DEST is set to ORACLE_HOME/log V$DIAG_INFO: query v$diag_info to check its ADR locations, including ADR BASE , ADR home , trace file locations , XML Alert location , incident dump locations , core dump and health monitor reports, number of problems, incidents reported in the database.

3. ADR home: the root directory for all diagnostic data for a particular instance of a particular Oracle product or component.

The following directories are under ADR HOME


o o o o

o o

alert: The alert directory contains the XML alert log: log.xml cdump: core dumps are stored in this directory hm : The hm directory stores reports for health checks incident: The incident directory stores dump files created when critical errors are encountered. Each occurrence of a critical error ( incident ) is given its own incident directory, with the incident ID used to form the directory name. incpkg, ir, lck, sweep: These directories contain internal diagnosability framework state. metadata: The metadata directory stores a series of files that contain diagnostic metadata.

trace: Process trace files and Alert.log are stored in the trace directory. 'Background_dump_dest' and 'user_dump_dest' are now ignored in 11g. Now all the trace files will be generated in 'trace' directory. diag/product_type/product_id/insance_id
o

examples:

diag/rdbms/orcl/ORCL1/: o product_type=rdms o product_id=db_name=orcl o instance_id=ORACLE_SID=ORCL diag/asm/+asm/+ASM o product_type=asm o product_id=+asm o instance_id=ORACLE_SID=+ASM diag/tnslsnr/node1/listener o product_type=tnslsnr - SQL*NET Listener o product_id=hostname=node1
o

instance_id=listener name=listener

4. problem versus incident

A problem is a critical error in the database: including internal errors, such as ORA-600, and other severe errors, such as ORA-7445 or ORA-4031. o Problem key: Every problem has a problem key, which is a text string that includes an error code (such as ORA 600) and in some cases, one or more error parameters. Eg: ORA 4030 , ORA 600 [ktfacht1-0] An incident is a single occurrence of a problem. When a problem occurs multiple times, an incident is created for each occurrence. o Each incident has a numeric incident id. Only the following Oracle errors can create an incident

Internal errors: ORA-00600 "internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]" ORA-00700 "soft internal error, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]" ORA-07445 "exception encountered: core dump [%s] [%s] [%s] [%s] [%s] [%s]" Some of the External Errors are: ORA-04030 "out of process memory when trying to allocate %s bytes (%s, %s)" ORA-04031 "unable to allocate %s bytes of shared memory (\"%s\",\"%s\",\"%s\",\"%s\")" ORA-29740 "evicted by member %s, group incarnation %s" ORA-01578 "ORACLE data block corrupted (file # %s, block # %s)" ORA-00353 "log corruption near block %s change %s time %s" ORA-00355 "change numbers out of order"

ORA-00356 "inconsistent lengths in change description" 5. ADR files in Oracle 10g Diagnostic Previous Location Data Foregroun user_dump_dest d Process Traces Backgroun background_dump_dest d Process Traces Alert Log background_dump_dest File SQL*Net Listener Log File Core Dump Files Incident Dump Files log_directory_listener core_dump_dest

ADR Location ADR HOME/trace ADR HOME/trace ADR HOME/alert/log.xml ADR HOME/trace/alert_<SID>.lo g ADR HOME/alert /log.xml ADR HOME/cdump

<user/background>_dump_de ADR st HOME/incident/incdir_n

6. ADRCI: ADR Command Interpreter


An Oracle utility investigating problems, viewing health check reports, and packaging and uploading first-failure diagnostic data to Oracle Support viewing the names of the trace files in ADR and the alert log

7. Errors that trigger Automatic Health Check Database structure Redo integrity checkData block integrity integrity check check ORA-202 ORA-353 ORA-1578 ORA-214 ORA-1103 ORA-312 ORA-313 ORA-1110

Transaction integrity check ORA-600 ORA-600 ORA-600 ORA-600 ORA-600 ORA-600 ORA-600 [4136] [4137] [4139] [4140] [4143] [4144] [4152]

8. Unable to view log.xml in a web browser

Error when attempting to open the XML formatted alert file log.xml in a web browser such as IE.

The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

Only one top level element is allowed in an XML document. Error processing resource 'file:///H:/temp/log.xml'. Line 7, Pos...
<msg time='2011-01-06T20:27:09.588-08:00' org_id='oracle' comp_id='tnslsnr' -^

Reason: log.xml is actually not comprised of a single rooted XML document which applications such as Internet Explorer would expect. This file merely contains XML fragments.

How to set the trace level:


[oracle@vm-rac1 ~]$ rsqlplus "/ as sysdba" SQL*Plus: Release 11.1.0.6.0 - Production on Sun Aug 19 02:35:23 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> show parameter log_archive_trace NAME TYPE VALUE ------------------------------------ ---------------------------------------log_archive_trace integer 0 SQL> alter system set log_archive_trace=79; System altered. SQL> alter system switch logfile; System altered. SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing

options [oracle@vm-rac1 ~]$ talert # my shell alias to tail the current alert log Current log# 1 seq# 7 mem# 0: /u01/app/oracle/oradata/test11g/redo01.log Sun Aug 19 02:03:14 2007 ARC3: Evaluating archive log 3 thread 1 sequence 6 ARC3: Beginning to archive thread 1 sequence 6 (627362-628594) (test11g) ARC3: Creating local archive destination LOG_ARCHIVE_DEST_10: '/u01/app/oracle/flash_recovery_area/TEST11G/archivelog/2007_08_19/o1_m f_1_6_%u_.arc' (thread 1 sequence 6) (test11g) ARC3: Creating local archive destination LOG_ARCHIVE_DEST_1: '/u01/app/oracle/11.1.0/db_1/dbs/arch1_6_630935902.dbf' (thread 1 sequence 6) (test11g) ARC3: Closing local archive destination LOG_ARCHIVE_DEST_10: '/u01/app/oracle/flash_recovery_area/TEST11G/archivelog/2007_08_19/o1_m f_1_6_3dh5pld1_.arc' (test11g) Committing creation of archivelog '/u01/app/oracle/flash_recovery_area/TEST11G/archivelog/2007_08_19/o1_m f_1_6_3dh5pld1_.arc' ARC3: Closing local archive destination LOG_ARCHIVE_DEST_1: '/u01/app/oracle/11.1.0/db_1/dbs/arch1_6_630935902.dbf' (test11g) Committing creation of archivelog '/u01/app/oracle/11.1.0/db_1/dbs/arch1_6_630935902.dbf' ARC3: Completed archiving thread 1 sequence 6 (627362-628594) (test11g)

Oracle 11gR1 Listener Log Location


Filed under: oracle mdinh @ 10:42 pm I am just getting my feet wet with 11gR1. When I executed lsnrctl status, I get the following: <click image to enlarge>

The Listener Log File is in XML format. Wheres the regular listener.log file?

It is located one directory above under trace. <click image to enlarge>

This all relates to the new parameter DIAGNOSTIC_DEST in 11g. REFERENCE: Oracle Database Reference 11g Release 1 (11.1) Comments (3)
Like Be the first to like this post.

3 Comments
1. Hi, 11g logs now reside on %ORACLE_HOME%\diag directory. The regular listener log is in %ORACLE_HOME%\diag\tnslsnr\listener\. Frankly, I really hate 11gs new log dir configuration under 11g, but you can change the location of the log by specifying the LISTENER_LOG=c:\ora11g\network\log in the listener.ora and restart the Listener. The same applies to the alert log with DIAGNOSTIC_DEST parameter in the init.ora file, but the directory structure is still cumbersome as compared to 10g. In this case, Oracle does make it harder for DBAs. Hope this helps.

Tam Comment by Tam Nguyen March 16, 2009 @ 6:00 pm | Reply 2. Tam Nguygens advice for the listener is wrong. When ADR is on you can not change the listener logging parameters. If you dont want to use ADR for the listener then add DIAG_ADR_ENABLED_listener_name=off into your listener.ora and then restart the listener. The log will go back to the old location either in $OH/network/log or the directory you set with LOG_DIRECTORY_listener_name Comment by BC May 27, 2009 @ 2:21 pm | Reply
o

on 11G (EBS 12.1 version) I knew sqlnet.log file is gone and information move to alert.log. How about listener.log file, I can not find it in anywhere? Check under $ORACLE_HOME/diag and/or $ORACLE_HOME/network/log directories. You can also get the exact location of listener.log file from "lsnrctl status" command.

You might also like