28 | 03 | 2024
Latest Articles
Popular Articles

Administration

ADR Automatic Diagnostic Repository

User Rating:  / 0
PoorBest 

ADR : The Automatic Diagnostic Repository.

 

In previous releases the vast majority of the trace files where generated in the $ORACLE_BASE/admin/$SID directories. (bdump, udump, cdump,...)

However some Oracle products like Oracle Clusterware had their own location for trace files. It could become cumbersome to regroup together all the info you found at various locations. In 11G the various trace files have a unified location, which regroups all the trace files and diagnostic information together.

Also the Oracle 11G engine reports automatically incidents and problems into the ADR. ( An incident is an occurence of a problem ). It is possible to package the trace files together with the Incident Packaging Service : IPS trace files can then be packaged together and uploaded to Oracle Support Services. 

Also it is possible to use the ADR Command Interpreter (ADRCI)  

 

SQL> show parameter diagnostic_dest

NAME                                 TYPE        VALUE
diagnostic_dest                      string      C:\ORACLE\PRODUCT\11.1.0

 


The old parameters are still there, hence we notice the directories are by default created under the diagnostic_dest parent directory


SQL> select name name,value from v$parameter where name like '%_dump_%';
NAME

 

background_dump_dest

c:\oracle\product\11.1.0\diag\rdbms\platinum\platinum\trace

user_dump_dest

c:\oracle\product\11.1.0\diag\rdbms\platinum\platinum\trace

core_dump_dest

c:\oracle\product\11.1.0\diag\rdbms\platinum\platinum\cdump 

 

We discover the DIAGNOSTIC_DEST/diag/rdbms/$SID/$SERVICE_NAME/trace directory were we find

1. the alert log in plain text
2. the background process trace files
3. the user process trace files


We discover the DIAGNOSTIC_DEST/diag/rdbms/$SID/$SERVICE_NAME/alert directory where we find the alert file in XML format

 

A nice option is that you can browse the alert file using adrci

 

[oracle@myhost rdbms]$ adrci

ADRCI: Release 11.1.0.7.0 - Production on Thu Aug 22 09:54:42 2013

Copyright (c) 1982, 2007, Oracle. All rights reserved.

ADR base = "/u01/app/oracle"

adrci> help

HELP [topic]
Available Topics:
CREATE REPORT
ECHO
EXIT
HELP
HOST
IPS
PURGE
RUN
SET BASE
SET BROWSER
SET CONTROL
SET ECHO
SET EDITOR
SET HOMES | HOME | HOMEPATH
SET TERMOUT
SHOW ALERT
SHOW BASE
SHOW CONTROL
SHOW HM_RUN
SHOW HOMES | HOME | HOMEPATH
SHOW INCDIR
SHOW INCIDENT
SHOW PROBLEM
SHOW REPORT
SHOW TRACEFILE
SPOOL

There are other commands intended to be used directly by Oracle, type
"HELP EXTENDED" to see the list

adrci> show alert -p "message_text like '%ORA-%'"

adrci> show home
ADR Homes:
diag/tnslsnr/myhost/listener
diag/rdbms/mydb/mydb
diag/clients/user_oracle/host_149508360_11

adrci> set home diag/rdbms/mydb/mydb

adrci> show alert -tail

2013-08-22 08:11:53.781000 +02:00
Current log# 19 seq# 334315 mem# 0: /u01/oradata/mydb/redo19.log
2013-08-22 08:14:25.702000 +02:00
Thread 1 advanced to log sequence 334316 (LGWR switch)
Current log# 20 seq# 334316 mem# 0: /u01/oradata/mydb/redo20.log
2013-08-22 08:14:41.411000 +02:00
Thread 1 advanced to log sequence 334317 (LGWR switch)
Current log# 11 seq# 334317 mem# 0: /u01/oradata/mydb/redo11.log
2013-08-22 08:16:25.781000 +02:00
Thread 1 advanced to log sequence 334318 (LGWR switch)
Current log# 12 seq# 334318 mem# 0: /u01/oradata/mydb/redo12.log
2013-08-22 08:24:49.903000 +02:00
Thread 1 advanced to log sequence 334319 (LGWR switch)
Current log# 13 seq# 334319 mem# 0: /u01/oradata/mydb/redo13.log
2013-08-22 08:29:40.515000 +02:00
Thread 1 advanced to log sequence 334320 (LGWR switch)
Current log# 14 seq# 334320 mem# 0: /u01/oradata/mydb/redo14.log
2013-08-22 09:09:53.705000 +02:00
Thread 1 advanced to log sequence 334321 (LGWR switch)
Current log# 15 seq# 334321 mem# 0: /u01/oradata/mydb/redo15.log
2013-08-22 09:14:36.821000 +02:00
Thread 1 advanced to log sequence 334322 (LGWR switch)
Current log# 16 seq# 334322 mem# 0: /u01/oradata/mydb/redo16.log
2013-08-22 09:20:18.565000 +02:00
Thread 1 cannot allocate new log, sequence 334323
Private strand flush not complete
Current log# 16 seq# 334322 mem# 0: /u01/oradata/mydb/redo16.log
2013-08-22 09:20:27.068000 +02:00
Thread 1 advanced to log sequence 334323 (LGWR switch)
Current log# 17 seq# 334323 mem# 0: /u01/oradata/mydb/redo17.log
2013-08-22 09:55:25.795000 +02:00
Thread 1 advanced to log sequence 334324 (LGWR switch)
Current log# 18 seq# 334324 mem# 0: /u01/oradata/mydb/redo18.log


One can also query v$diag_info

 

SQL> set pages 9999
SQL> set lines 300
SQL> select * from v$diag_info;

INST_ID NAME

1 Diag Enabled
TRUE
1 ADR Base
/u01/app/oracle

1 ADR Home
/u01/app/oracle/diag/rdbms/mydb/mydb

1 Diag Trace
/u01/app/oracle/diag/rdbms/mydb/mydb/trace

1 Diag Alert
/u01/app/oracle/diag/rdbms/mydb/mydb/alert

1 Diag Incident
/u01/app/oracle/diag/rdbms/mydb/mydb/incident

1 Diag Cdump
/u01/app/oracle/diag/rdbms/mydb/mydb/cdump

1 Health Monitor
/u01/app/oracle/diag/rdbms/mydb/mydb/hm

1 Default Trace File
/u01/app/oracle/diag/rdbms/mydb/mydb/trace/mydb_ora_30476.trc

1 Active Problem Count 2

Active Incident Count 550

11 rows selected.

 

Good to know is that trace files are automatically purged after a given time, there are 2 periods

 

1. LONGP_POLICY  ( for Incidents, Problems, Health Monitor reports ), default retention is 1 year = 8760 hours

2. SHORTP_POLICY ( for trace files, dumps, ect ), default retention is 1 month = 720 hours

 

a DBA can alter this, example if one would like to get the automatically purge faster

 

adrci> set control (LONGP_POLICY = 4380 )


adrci> set control (SHORTP_POLICY = 360 )


adrci> show control

 

The DBA can also manually purge some ADR data with commands like

 

adrci> purge -age 12000 -type TRACE

 

Type is any of the following : ALERT, INCIDENT, TRACE, CDUMP, HM