ORACLE AWR概述及生成AWR报告
1.Overview of the Automatic Workload Repository
The Automatic Workload Repository (AWR) collects, processes, and maintains performance statistics for problem detection and self-tuning purposes. This data is both in memory and stored in the database. The gathered data can be displayed in both reports and views.
The statistics collected and processed by AWR include:
Object statistics that determine both access and usage statistics of database segments
Time model statistics based on time usage for activities, displayed in the
V$SYS_TIME_MODEL
andV$SESS_TIME_MODEL
viewsSome of the system and session statistics collected in the
V$SYSSTAT
andV$SESSTAT
viewsSQL statements that are producing the highest load on the system, based on criteria such as elapsed time and CPU time
ASH statistics, representing the history of recent sessions activity
Gathering database statistics using the AWR is enabled by default and is controlled by the STATISTICS_LEVEL
initialization parameter. TheSTATISTICS_LEVEL
parameter should be set to the TYPICAL
or ALL
to enable statistics gathering by the AWR. The default setting is TYPICAL
. Setting STATISTICS_LEVEL
to BASIC
disables many Oracle Database features, including the AWR, and is not recommended. If STATISTICS_LEVEL
is set to BASIC
, you can still manually capture AWR statistics using the DBMS_WORKLOAD_REPOSITORY
package. However, because in-memory collection of many system statistics—such as segments statistics and memory advisor information—will be disabled, the statistics captured in these snapshots may not be complete. For information about the STATISTICS_LEVEL
initialization parameter, see Oracle Database Reference.
2. Setting the Level of Statistics Collection
Oracle Database provides the initialization parameter STATISTICS_LEVEL
, which controls all major statistics collections or advisories in the database. This parameter sets the statistics collection level for the database.
Depending on the setting of STATISTICS_LEVEL
, certain advisories or statistics are collected, as follows:
BASIC
: No advisories or statistics are collected. Monitoring and many automatic features are disabled. Oracle does not recommend this setting because it disables important Oracle Database features.TYPICAL
: This is the default value and ensures collection for all major statistics while providing best overall database performance. This setting should be adequate for most environments.(在生成ARW报告前,先检查参数STATISTICS_LEVEL,默认为TYPICAL即可)ALL
: All of the advisories or statistics that are collected with theTYPICAL
setting are included, plus timed operating system statistics and row source execution statistics.- The V$STATISTICS_LEVEL view displays information about the status of the statistics or advisories controlled by the STATISTICS_LEVEL parameter. See "V$STATISTICS_LEVEL".可通过该视图查看这三个参数的信息。
SQL> desc v$statistics_level;
Name Type Nullable Default Comments
-------------------- -------------- -------- ------- --------
STATISTICS_NAME VARCHAR2(64) Y
DESCRIPTION VARCHAR2(4000) Y
SESSION_STATUS VARCHAR2(8) Y
SYSTEM_STATUS VARCHAR2(8) Y
ACTIVATION_LEVEL VARCHAR2(7) Y
STATISTICS_VIEW_NAME VARCHAR2(64) Y
SESSION_SETTABLE VARCHAR2(3) Y
3.Generating Automatic Workload Repository Reports
An AWR report shows data captured between two snapshots (or two points in time). The AWR 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 reports is Oracle Enterprise Manager. Whenever possible, you should generate AWR reports using Oracle Enterprise Manager, as described in Oracle Database 2 Day + Performance Tuning Guide(在OEM界面生成AWR).If Oracle Enterprise Manager is unavailable, you can generate AWR reports by running SQL scripts, as described in the following sections:
3.1 Generating an AWR Report(使用SQL脚本生成AWR)
The awrrpt.sql
SQL script generates an HTML or text report that displays statistics for a range of snapshot IDs.
To generate an AWR report:
At the SQL prompt, enter:
@$ORACLE_HOME/rdbms/admin/awrrpt.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.
Specify the number of days for which you want to list snapshot IDs.
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 workload repository report:
Enter value for begin_snap: 150
Enter value for end_snap: 160In this example, the snapshot with a snapshot ID of 150 is selected as the beginning snapshot, and the snapshot with a snapshot ID of 160 is selected as the ending snapshot.
Enter a report name, or accept the default report name:
Enter value for report_name:
Using the report name awrrpt_1_150_160In this example, the default name is accepted and an AWR report named
awrrpt_1_150_160
is generated.
3.2WINDOWS环境下生成AWR报告:
在该目录下@$ORACLE_HOME/rdbms/admin/以sysdba身份登录sqlplus
I:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN>sqlplus / as sysdba;
在sqlplus中输入@awrrpt
其它步骤同上。
注意:(两个snap id之间的时间必须是连续的,且不允许有停机)
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~
输入 begin_snap 的值: 1
Begin Snapshot Id specified: 1
输入 end_snap 的值: 18
End Snapshot Id specified: 18
===================
3.3 生成其它ARW报告:
Generating an Oracle RAC AWR Report on Specific Database Instances
Generating an AWR Report for a SQL Statement on a Specific Database Instance
《FROM:转自ORACLE官方文档:http://docs.oracle.com/cd/E11882_01/server.112/e41573/autostat.htm#PFGRF94202》
ORACLE AWR概述及生成AWR报告的更多相关文章
- Oracle AWR 之 通过dbms_workload_repository.awr_report_text(html)函数在客户端生成AWR报告
1.概述 一般情况下,awr报告都是通过在oracle服务器的sqlplus窗口调用$ORACLE_HOME/rdbms/admin/awrrpt.sql脚本生成报告.方法如下: [oracle@lo ...
- Oracle 每天自动生成AWR报告
经验丰富的老员工希望能够每天为数据库生成1个AWR报告,以便于后期分析数据库的性能变化,手动生成太麻烦,查了一下资料,发现可以自动生成,过程如下. 数据库环境:11gR2 RAC(双节点) AWR报告 ...
- oracle手工生成AWR报告方法记录
AWR(Automatic Workload Repository)报告是我们进行日常数据库性能评定.问题SQL发现的重要手段.熟练掌握AWR报告,是做好开发.运维DBA工作的重要基本功. AWR报告 ...
- oracle生成AWR报告方法
2018-04-02 19:59:42 在10g 11g中AWR自动的每隔一小时进行一次数据采集并生成快照.下面是生成AWR报告的步骤: 1:使用oracle用户在数据库服务器上执行如下命令 sqlp ...
- oracle中如何生成awr报告
oracle中如何生成awr报告 1.进入数据库 sqlplus / as sysdba 2.查看用户 show parameter db_name 3.开始压测后执行 exec DBMS_WOR ...
- Oracle 11g AWR 系列五:如何生成 AWR 报告?
1.生成单实例 AWR 报告: @$ORACLE_HOME/rdbms/admin/awrrpt.sql 2.生成 Oracle RAC AWR 报告: @$ORACLE_HOME/rdbms/adm ...
- oracle命令生成AWR报告
--命令生成AWR报告oracle@linux:~> sqlplus / as sysdba SQL*Plus: Release 11.1.0.7.0 - Production on Fri A ...
- oracle手工生成AWR报告方法
AWR(Automatic Workload Repository)报告是我们进行日常数据库性能评定.问题SQL发现的重要手段.熟练掌握AWR报告,是做好开发.运维DBA工作的重要基本功. AWR报告 ...
- windows主机上ORACLE生成awr报告的步骤
oracle数据库是一个大型的关系型数据库,那么如果有一天装载数据库的主机由于大量的IO操作导致主机cpu荷载超过100%会使得主机卡顿或者对数据库连接或者进行数据库进行正常的IO操作都会产生影响,所 ...
随机推荐
- 有关Oracle cvu和cvuqdisk
有关Oracle cvu和cvuqdisk cvu的下载链接: http://www.oracle.com/technetwork/products/clustering/downloads/cvu- ...
- 使用 AngularJS 和 ReactJS 的经验
1. React 福音 当我们的团队开始寻找一个合适的前端框架的时候,我们考虑了许多选择,最后留下两个选项 —— Angular 和 React. Angular 是目前为止最成熟的方案:它拥有一个庞 ...
- Unity NGUI 血条制作
NGUI 血条制作步骤 实现过程: 模拟血条的变化当点击按钮Button是血条会实时发生变化. 1.向Unity中导入NGUI2.6.3.unitypackage 点击create your ui 后 ...
- mysql开启慢查询日志
5.1版本之前,在 my.cnf添加如下信息, long_query_time=1 log_slow_queries=/data/mysql/slow.log 5.1版本之后,在 my.cnf添加如下 ...
- C#实现WinForm传值实例解析
C#实现WinForm传值的问题经常会做为公司面试的题目,那么作为学习C#以及WinForm传值,我们需要掌握哪些方法和思路呢?下面我们就向你介绍详细的思路和实现的具体步骤,希望对你有所帮助. C#实 ...
- 代码初始化 故事板初始化 xib初始化总结
对象的初始化有三种方式 // 代码创建 - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { ...
- (转载)C++之tinyXML使用
tinyXML一款很优秀的操作C++类库,文件不大,但方法很丰富,和apache的Dom4j可以披靡啊!习惯了使用java类库的我看到这么丰富的c++类库,很高兴!它使用很简单,只需要拷贝几个文件到 ...
- 菜单之二:使用xml文件定义菜单
参考<疯狂android讲义>2.10节 P174,参见归档project:XmlMenuDemo.zip 一般推荐使用XML文件定义菜单. 基本步骤如下: 1.定义布局文件 为简单显示原 ...
- Android 使用BroadcastReceiver的几种方法
发送自定义广播 全局广播 发送标准广播 1.定义广播接收器.(在发送广播前,需要先定义一个广播接收器,不然发了也是白发) public class MyBroadcastReceiver extend ...
- 异常处理 - PHP手册笔记
PHP代码中所产生的异常可被throw语句抛出,并被catch语句捕获.需要进行异常处理的代码都必须放入try代码块内,每一个try至少要有一个与之对应的catch.当一个异常被抛出时,所在代码块后面 ...