11g Understanding Automatic Diagnostic Repository.

Oracle 11g ADR详解

Beginning with Release 11g, Oracle Database includes an advanced fault diagnosability infrastructure for preventing, detecting, diagnosing, and resolving problems. This note helps to understandthenew11g infrastructure known as Automatic Diagnostic Repository.

Scope and Application

Audience: Oracle 11g Users and DBAs who want to know about ADR.

11g Understanding Automatic Diagnostic Repository.

What is New in 11g?

In 11g, RDBMS diagnostic data has been reorganized and is stored inside a common directory structure, the Automatic Diagnostic Repository (ADR). An ADR is a centralized directory structure where one can find trace files, alert messages, incident dumps, core files, etc.

Automatic Diagnostic Repository ( ADR ) :

All trace files, core files, and the alert files are now organized into a directory structure comprising the Automatic Diagnostic Repository (ADR).

The ADR is a file-based repository for database diagnostic data. It has a unified directory structure across multiple instances and multiple products.
Beginning with Release 11g, the database, Automatic Storage Management (ASM), Cluster Ready Services (CRS), and other Oracle products or components store all diagnostic data in the ADR. Each instance of each product stores diagnostic data underneath its own ADR home directory.
For example, in an Oracle Real Application Clusters environment with shared storage and ASM, each database instance and each ASM instance has a home directory within the ADR. ADR's unified directory structure, consistent diagnostic data formats across products and instances, and a unified set of tools enable customers and Oracle Support to correlate and analyze diagnostic data across multiple instances.

Problems and Incidents :

Problem : is a critical error in the database
Eg : ora-600 , ora-7445 , ora-4031 etc.

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]’

Incident : is a single occurance of a problem . Each incident has a numeric incident id.


Where is ADR located :

The location of the ADR is controlled by the Oracle "diagnostic_dest" parameter.
Path specified in the 'diagnostic_dest' parameter defines the ADR root directory,ADR BASE.
The first subdirectory inside an ADR (under the <adr_base> directory) is always named "diag"

For example, if the 'diagnostic_dest' and thus the <adr_base> is specified as "$ORACLE_HOME/log", then expect to find the subdirectory "$ORACLE_HOME/log/diag". Below this will be <adr_home> .
Any number of instances/components can share same ADR BASE. Under ADR BASE there will be individual ADR HOMES.
Under ADR BASE ,the address of an <adr_home> will be similar to :
diag/<product_type>/<prod_id>/<instance_id>.
Inside each ADR home, you can find several subdirectories, each for storing a specific type of diagnostic data. Among the subdirectories, you should be able to find TRACE, ALERT, INCIDENT, CDUMP etc.

ADR HOME contents :

You will find the following directories under ADR HOME -

Alert : The alert directory contains the XML alert log

Cdump : core dumps are stored in this directory

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.

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.

Metadata : The metadata directory stores a series of files that contain diagnostic metadata.

HM : The hm directory stores reports for health checks

Incpkg, ir, lck, sweep : These directories contain internal diagnosability framework state.


DIAGNOSTIC_DEST - Default value :

If environment variable ORACLE_BASE is set, DIAGNOSTIC_DEST is set to the directory designated by ORACLE_BASE.
If environment variable ORACLE_BASE is not set, DIAGNOSTIC_DEST is set to ORACLE_HOME/log

V$DIAG_INFO :

For each database , you can query v$diag_info to check its ADR locations.
This shows us the ADR BASE , ADR home , trace file locations , XML Alert location , incident dump locations , core dump and health monitor reports.
Also gives us the default session trace ( for the current session ) and number of problems , incidents reported in the database.

ADR Command Interpreter (ADRCI) :

ADRCI is the command line utility using which ADR is accessed.

Enter the following command at the operating system command prompt:

%]ADRCI

The utility starts and displays the following prompt:

adrci>

There are various commands that can be executed from 'adrci' to view Alert log , trace files , incidents reported , etc.

There is no need to log in to ADRCI, because the data in ADR is just for diagnostic purposes and not intended to be secure. ADR data is secured only by operating system permissions on the ADR directories.

From Oracle

-------------------------------------------------------------------------------------------------------

Blog http://blog.youkuaiyun.com/tianlesoftware

Email: dvd.dba@gmail.com

DBA1 群:62697716(); DBA2 群:62697977() DBA3 群:62697850()

DBA 超级群:63306533(); DBA4 群: 83829929 DBA5群: 142216823

聊天 群:40132017 聊天2群:69087192

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请

<think>好的,我现在需要回答用户关于Oracle ADR存储位置的问题。用户之前问过关于RMAN备份遇到坏块的问题,现在转到了ADR的存储位置。我需要先回顾用户提供的引用内容,确保答案准确。 根据引用[2],ADR的基本目录由初始化参数diagnostic_dest指定。用户可以通过SQL命令`show parameter diagnostic_dest`来查看这个路径。例如,如果diagnostic_dest是/u01/app/oracle,那么ADR的基本目录就是这个路径。 引用[3]提到,可以通过查询v$diag_info视图来获取ADR的具体路径信息,比如ADR Base、ADR Home等。例如,ADR Base对应基目录,ADR Home是当前实例的主目录,包含各个子目录如Diag Trace、Diag Alert等。 用户可能需要知道如何查找这些路径,所以需要分步骤说明方法:使用SQL查询参数和视图,以及查看文件系统结构。同时,要指出默认位置(如果未设置diagnostic_dest的话),比如ORACLE_BASE下的log目录。 需要注意引用中的细节,例如ADR的结构,每个实例有自己的主目录,路径层次的一致性。还要提到Alert Log的位置,这在引用[4]和[5]中都有说明,位于ADR Home下的trace目录中,可能以alert_.log的形式存在。 用户可能还会关心如何验证或修改diagnostic_dest,需要简要说明。同时,确保回答结构清晰,分点列出,引用正确的来源,比如引用[1]-[5]中的相关内容。 最后,生成相关问题,比如如何修改存储位置,如何查看日志内容等,帮助用户进一步了解ADR的管理。</think>### **Oracle ADR存储位置详解** #### **一、核心结论** Oracle ADR(Automatic Diagnostic Repository)的存储位置由初始化参数 **`diagnostic_dest`** 决定,其路径可通过以下方式查看: 1. **直接查询参数**: ```sql SHOW PARAMETER diagnostic_dest; ``` 示例输出: ``` NAME TYPE VALUE ---------------- ------- ------------------------------ diagnostic_dest string /u01/app/oracle ``` - 若未显式设置`diagnostic_dest`,默认值为 **`ORACLE_BASE`**(若`ORACLE_BASE`未定义,则指向`ORACLE_HOME/log`)[^2][^3]。 2. **查询动态视图`v$diag_info`**: ```sql SELECT * FROM v$diag_info; ``` 关键字段: - **ADR Base**:ADR根目录(如`/u01/app/oracle`)[^3]。 - **ADR Home**:当前实例的ADR主目录(如`/u01/app/oracle/diag/rdbms/orcl/orcl`)[^1]。 - **Diag Trace**:跟踪文件目录(包含`alert_<SID>.log`等日志)[^4][^5]。 --- #### **二、目录结构解析** ADR采用标准化的目录层次结构,以数据库实例为例: ``` ADR Base │ └───diag └───rdbms └───<db_name> -- 数据库名称 └───<instance_name> -- 实例名称 ├───alert -- XML格式的警报日志 ├───trace -- 文本格式的跟踪文件(含`alert_<SID>.log`) ├───incident -- 意外事件记录 └───... -- 其他子目录(如cdump、hm等) ``` - **关键文件位置**: - **警报日志(Alert Log)**:`<ADR Home>/trace/alert_<SID>.log` [^4][^5]。 - **跟踪文件(Trace Files)**:`<ADR Home>/trace`目录下的`.trc`或`.trm`文件。 - **健康监控报告**:`<ADR Home>/hm`目录。 --- #### **三、特殊场景说明** 1. **多组件环境(如RAC、ASM)**: - 每个组件(如数据库实例、ASM实例、监听器)均有独立的ADR Home目录。 - 示例: - **ASM实例**:`<ADR Base>/diag/asm/+asm/+ASM` - **监听器**:`<ADR Base>/diag/tnslsnr/<hostname>/listener` [^1]。 2. **诊断数据持久性**: - ADR数据不会随数据库实例重启而清除,需定期手动清理或通过ADRCI工具维护[^1][^3]。 --- #### **四、验证与修改方法** 1. **验证当前配置**: - **方法1**:通过SQL*Plus查询: ```sql SHOW PARAMETER diagnostic_dest; ``` - **方法2**:通过操作系统环境变量: ```bash echo $ORACLE_BASE ``` (若`diagnostic_dest`未显式设置,默认与`ORACLE_BASE`一致)[^2][^3]。 2. **修改存储位置**: - **步骤1**:修改参数文件(需重启数据库生效): ```sql ALTER SYSTEM SET diagnostic_dest='/new/path' SCOPE=SPFILE; ``` - **步骤2**:重启数据库: ```sql SHUTDOWN IMMEDIATE; STARTUP; ``` --- #### **五、引用支持** - [^1]: ADR为Oracle组件提供统一的诊断数据存储结构,每个实例有独立目录。 - [^2]: `diagnostic_dest`参数决定ADR根目录,默认与`ORACLE_BASE`关联。 - : 通过`v$diag_info`可获取完整的路径信息。 - [^4][^5]: 警报日志(Alert Log)是运维关键文件,记录数据库重要事件。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值