Free Newsletters:
Database Journal  
DBAnews  

DBASupport

 The Knowledge Center for Oracle Professionals

Search DBAsupport:
 
HOME 11g Central 10g Central 9i Central 8i Central Oracle News Scripts FAQ OCP Zone Resources Technical Docs Tools & Utilities Forums
internet.com

» HOME
» FEATURES
    11g Central
    10g Central
    9i Central
    8i Central
    Oracle News
» COMMUNITY
    Scripts
    Forums
    FAQ
    OCP Zone
» RESOURCES
    Resources
    Technical Docs
    Tools & Utilities
    Tech Jobs

Marketplace Partners
Become a Marketplace Partner


internet.commerce
Be a Commerce Partner












internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


   DBAsupport.com > Oracle > Oracle 11g Central > Featured Stories




Information Technology Auditor (PA)
Next Step Systems
US-PA-Wayne

Justtechjobs.com Post A Job | Post A Resume

Oracle’s ADR Command Interpreter – Part I
James Koopmann, jkoopmann@pinehorse.com


Oracle’s new ADR with command interface shows promise as a way for DBAs to quickly investigate diagnostic information.

New to Oracle Release 11g, Oracle has beefed up, revamped, and made better its infrastructure for DBAs to handle, diagnose, collect, report, and manage diagnostic information. Most of the information that falls into this category we have all been introduced to before: alert logs, trace files, dumps, core files, etc. The newness of this diagnostic information is how Oracle has structured a repository and provided a tool to investigate issues. Now we can more easily identify, track, and resolve problems. Let’s take a quick look in part I of a series that will take us from conception of ADR through using ADR’s command interpreter.

Before we get too excited, Oracle’s Automatic Diagnostic Repository (ADR) is not any new embedded database or even a hook into the current engine. In fact, it is a file-based repository. We are used to this format and it is actually an efficient way to keep diagnostic information. If it were in a database, we would be subject to a database’s availability. With a file-based system, we are also able to do other activities, such as hook the data into external reporting systems. Because this is a new feature, we now have a new initialization parameter. The BACKGROUND_DUMP_DEST and USER_DUMP_DEST are now deprecated and replaced by DIAGNOSTIC_DEST. To see your current setting, just issue the following SHOW command.

SQL> show parameter diag

NAME                  TYPE        VALUE
--------------------- ----------- ----------------
diagnostic_dest       string      /opt/app/oracle

This DIAGNOSTIC_DEST parameter points to the top directory in a structure stored outside the Oracle database and has the general structure as follows. As there can be multiple directory structures under a single DIAGNOSTIC_DEST it is good to know that it is segregated by product, product id, and instance name.

/opt/app/oracle
./rdbms
 `-- db11
     `-- db11
         |-- alert
         |-- cdump
         |-- hm
         |-- incident
         |-- incpkg
         |-- ir
         |-- lck
         |-- metadata
         |-- stage
         |-- sweep
         `-- trace

A couple of the key subdirectories and their contents, most of which we are familiar with would be:

Subdirectory

Contents

alert

Find the XML alert log here

cdump

Location for core files

incident

This one is new to me and we will surely be looking closely at it. But it contains multiple subdirectories where each subdirectory is an incident and contains multiple dump files for that incident.

trace

Location for background, server, and SQL trace files

Also contains the old alert.log (non-XML) file

Others

hm, incpkg, ir, lck, metadata, stage, sweep

There is a view called V$DIAG_INFO that can also help you find these locations if you just can’t remember the structure. Alternatively, in the case of scripting with Oracle, you can use the contents of this view to intelligently script reports through the ADR command interface. To view the contents, displaying the locations of the subdirectories of ADR, use the following SQL.

SQL> SELECT name,value FROM v$diag_info;

NAME                      VALUE
------------------------- ------------------------------------------------------------
Diag Enabled              TRUE
ADR Base                  /opt/app/oracle
ADR Home                  /opt/app/oracle/diag/rdbms/db11/db11
Diag Trace                /opt/app/oracle/diag/rdbms/db11/db11/trace
Diag Alert                /opt/app/oracle/diag/rdbms/db11/db11/alert
Diag Incident             /opt/app/oracle/diag/rdbms/db11/db11/incident
Diag Cdump                /opt/app/oracle/diag/rdbms/db11/db11/cdump
Health Monitor            /opt/app/oracle/diag/rdbms/db11/db11/hm
Default Trace File        /opt/app/oracle/diag/rdbms/db11/db11/trace/db11_ora_3014.trc
Active Problem Count      0
Active Incident Count     0

11 rows selected.

Here you can see that ADR Base is the same as the DIAGNOSTIC_DEST initialization parameter. Since we will almost always go to the ADR Home subdirectory for an instance, this is a query you will want to have handy. It is also handy to notice the current trace file that will be used for your current session. If I were to connect with, or look at a different session, this default trace file would be different and unique to that session.

While we will get into the different types of data stored in ADR, I thought it appropriate to introduce you to how all this looks for something we are all familiar with, the alert log. In past Oracle releases, in order to view the alert log, you would need to carry out the following steps (assuming you’re from the old school and not using Enterprise Manager):

1.    Connect to the database with SQL*Plus

2.    Query V$DIAG_INFO view to find the Diag Trace directory

3.    Log into the database server

4.    Change directory to the Diag Trace directory

5.    Open the alert.log with a text editor

The above five steps are not difficult to do but we are not really left with much after we open the alert file, and, if we want to do any analysis on the alert.log file we have to write our own scripts. With the ADR command interface, the steps to view the alert log now become:

1.    Log into the database server

2.    Invoke the ADR command interface (adrci)

3.    Issue the SHOW ALERT command

Three steps compared to five isn’t much of a comparison. However, do notice I didn’t need to know where my trace directory existed. I just used the ADR command interface. After the SHOW ALERT command, I am immediately put into the vi editor and can browse my alert log. Now this might not be the best interface (vi) but since I’ve been using vi for over 20 years, I’m pretty happy. You might want to brush up on vi. If you just can’t live with vi, there is a SET EDITOR command where you can change the default editor. Aside from vi commands, the ADR command interface does have more powerful SHOW commands that will probably get you close to what you want. We will be investigating these in a future article but I found these following commands very quickly, very helpful, straight out of the documentation, and very much like a Unix tail command.

SHOW ALERT -TAIL; To display the last 10 lines of the alert log.

SHOW ALERT -TAIL 50; To display the last 50 lines of the alert log.

SHOW ALERT -TAIL -F; To display the last 10 lines of the alert log then wait for additional message to be written to the log, also displaying them to your session as they arrive. Use CTRL_C to exit this mode.

SHOW ALERT -P "MESSAGE_TEXT LIKE '%ORA-%'"; search for alert lines that have ORA- in them.

Oracle’s new ADR, with command interface looks very promising. The repository seems to be well structured and the command interface shows promise for DBAs to quickly view diagnostic information. Next time we will dive deeper into the different diagnostic information contained, the command interface.

Next


Back to DBAsupport.com





internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES