|
|||||||||||||
|
|
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.
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.
|
|||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
![]()