Automatic Workload Repository Compare Period report

本文介绍如何使用Oracle数据库的AWR(Automatic Workload Repository)功能来生成周期对比报告,帮助诊断不同时间段内的性能差异。通过比较两个时间段的配置设置、工作负载特性及统计数据,可以快速定位性能下降的原因。
部署运行你感兴趣的模型镜像
        Generating Automatic Workload Repository Compare Periods Reports
While an AWR report shows AWR data between two snapshots (or two points in time), the AWR Compare Periods report shows the difference between two periods (or two AWR reports, which equates to four snapshots). Using the AWR Compare Periods report helps you to identify detailed performance attributes and configuration settings that differ between two time periods. For example, if the application workload is known to be stable between 10:00 p.m. and midnight every night, but the performance on a particular Thursday was poor between 10:00 p.m. and 11:00 p.m., generating an AWR Compare Periods report for Thursday from 10:00 p.m. to 11:00 p.m. and Wednesday from 10:00 p.m. to 11:00 p.m. should identify configuration settings, workload profile, and statistics that were different in these two time periods. Based on the differences identified, the cause of the performance degradation can be more easily diagnosed. The two time periods selected for the AWR Compare Periods Report can be of different durations, because the report normalizes the statistics by the amount of time spent on the database for each time period, and presents statistical data ordered by the largest difference between the periods.
The AWR Compare Periods reports are divided into multiple sections. The HTML report includes links that can be used to navigate quickly between sections. The content of the report contains the workload profile of the system for the selected range of snapshots.
The primary interface for generating AWR Compare Periods reports is Oracle Enterprise Manager. Whenever possible, you should generate AWR Compare Periods reports using Oracle Enterprise Manager, as described in Oracle Database 2 Day + Performance Tuning Guide. If Oracle Enterprise Manager is unavailable, you can generate AWR Compare Periods reports by running SQL scripts, as described in the following sections:
Generating an AWR Compare Periods Report
Generating an AWR Compare Periods Report on a Specified Database Instance
To run these scripts, you must be granted the DBA role.
5.3.7.1 Generating an AWR Compare Periods Report
The awrddrpt.sql SQL script generates an HTML or text report that compares detailed performance attributes and configuration settings between two selected time periods.
To generate an AWR Compare Periods report:
At the SQL prompt, enter:
@$ORACLE_HOME/rdbms/admin/awrddrpt.sql
Specify whether you want an HTML or a text report:
Enter value for report_type: html
In this example, an HTML report is chosen.
Specify the number of days for which you want to list snapshot Ids in the first time period.
Enter value for num_days: 2
A list of existing snapshots for the specified time range is displayed. In this example, snapshots captured in the last 2 days are displayed.
Specify a beginning and ending snapshot ID for the first time period:
Enter value for begin_snap: 102
Enter value for end_snap: 103
In this example, the snapshot with a snapshot ID of 102 is selected as the beginning snapshot, and the snapshot with a snapshot ID of 103 is selected as the ending snapshot for the first time period.
Specify the number of days for which you want to list snapshot Ids in the second time period.
Enter value for num_days2: 1
A list of existing snapshots for the specified time range is displayed. In this example, snapshots captured in the previous day are displayed.
Specify a beginning and ending snapshot ID for the second time period:
Enter value for begin_snap2: 126
Enter value for end_snap2: 127
In this example, the snapshot with a snapshot ID of 126 is selected as the beginning snapshot, and the snapshot with a snapshot ID of 127 is selected as the ending snapshot for the second time period.
Enter a report name, or accept the default report name:
Enter value for report_name:
Using the report name awrdiff_1_102_1_126.txt
In this example, the default name is accepted and an AWR report named awrdiff_1_102_126 is generated.
5.3.7.2 Generating an AWR Compare Periods Report on a Specified Database Instance
The awrddrpi.sql SQL script generates an HTML or text report that compares detailed performance attributes and configuration settings between two selected time periods on a specific database and instance. This script enables you to specify a database and instance before selecting time periods to compare.
To generate an AWR Compare Periods report on a specified database instance:
At the SQL prompt, enter:
@$ORACLE_HOME/rdbms/admin/awrddrpi.sql
Specify whether you want an HTML or a text report:
Enter value for report_type: text
In this example, a text report is chosen.
A list of available database identifiers and instance numbers are displayed:
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
----------- -------- ------------ ------------ ------------
3309173529 1 MAIN main examp1690
3309173529 1 TINT251 tint251 samp251
Enter the values for the database identifier (dbid) and instance number (inst_num) for the first time period:
Enter value for dbid: 3309173529
Using 3309173529 for Database Id for the first pair of snapshots
Enter value for inst_num: 1
Using 1 for Instance Number for the first pair of snapshots
Specify the number of days for which you want to list snapshot Ids in the first time period.
Enter value for num_days: 2
A list of existing snapshots for the specified time range is displayed. In this example, snapshots captured in the last 2 days are displayed.
Specify a beginning and ending snapshot ID for the first time period:
Enter value for begin_snap: 102
Enter value for end_snap: 103
In this example, the snapshot with a snapshot ID of 102 is selected as the beginning snapshot, and the snapshot with a snapshot ID of 103 is selected as the ending snapshot for the first time period.
Enter the values for the database identifier (dbid) and instance number (inst_num) for the second time period:
Enter value for dbid2: 3309173529
Using 3309173529 for Database Id for the second pair of snapshots
Enter value for inst_num2: 1
Using 1 for Instance Number for the second pair of snapshots
Specify the number of days for which you want to list snapshot Ids in the second time period.
Enter value for num_days2: 1
A list of existing snapshots for the specified time range is displayed. In this example, snapshots captured in the previous day are displayed.
Specify a beginning and ending snapshot ID for the second time period:
Enter value for begin_snap2: 126
Enter value for end_snap2: 127
In this example, the snapshot with a snapshot ID of 126 is selected as the beginning snapshot, and the snapshot with a snapshot ID of 127 is selected as the ending snapshot for the second time period.
Enter a report name, or accept the default report name:
Enter value for report_name:
Using the report name awrdiff_1_102_1_126.txt
In this example, the default name is accepted and an AWR report named awrdiff_1_102_126 is generated on the database instance with a database ID value of 3309173529.

本文转自
http://download.oracle.com/docs/cd/B28359_01/server.111/b28274/autostat.htm#CHDBBEFB

您可能感兴趣的与本文相关的镜像

Stable-Diffusion-3.5

Stable-Diffusion-3.5

图片生成
Stable-Diffusion

Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率

<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、付费专栏及课程。

余额充值