手动生成AWR报告


一. AWR 说明

Oracle 10g之前对数据库做性能检测使用statspack工具. Oracle Database 10g 提供了一个新的工具:(AWR:Automatic Workload Repository)。Oracle 建议用户用这个取代 Statspack。AWR 实质上是一个 Oracle 的内置工具,它采集与性能相关的统计数据,并从那些统计数据中导出性能量度,以跟踪潜在的问题。与Statspack 不同,快照由一个称为 MMON 的新的后台进程及其从进程自动地每小时采集一次。为了节省空间,采集的数据在 7 天后自动清除。快照频率和保留时间都可以由用户修改。它产生两种类型的输出:文本格式(类似于 Statspack 报表的文本格式但来自于 AWR 信息库)和默认的 HTML 格式(拥有到部分和子部分的所有超链接)。

AWR 使用几个表来存储采集的统计数据,所有的表都存储在新的名称为 SYSAUX 的特定表空间中的 SYS 模式下,并且以 WRM$_* 和 WRH$_* 的格式命名。前一种类型存储元数据信息(如检查的数据库和采集的快照),后一种类型保存实际采集的统计数据。H 代表“历史数据 (historical)”而 M 代表“元数据(metadata)”。在这些表上构建了几种带前缀 DBA_HIST_ 的视图,这些视图可以用来编写您自己的性能诊断工具。视图的名称直接与表相关;例如,视图DBA_HIST_SYSMETRIC_SUMMARY 是在WRH$_SYSMETRIC_SUMMARY 表上构建的。

 
注意一点:
            statistics_level 有三个取值,分别是ALL,TYPICAL,BASIC,系统默认是typical,在10g中表监控是激活的,强烈建议在10g中此参数的值是typical。如果STATISTICS_LEVEL设置为basic,不仅不能监控表,而且将禁掉如下一些10g的新功能:
            ASH(Active Session History)
            ASSM(Automatic Shared Memory Management)
            AWR(Automatic Workload Repository)
            ADDM(Automatic Database Diagnostic Monitor)


二.  手动产生AWR报告
如果安装了OEM,则可以通过OEM来产生AWR报告,本例通过手动的产出AWR报告。
SQL> @?/rdbms/admin/awrrpt.sql

Current Instance
~~~~~~~~~~~~~~~~

  DB Id    DB Name      Inst Num Instance
----------- ------------ -------- ------------
 2100083002 TEST                1 test


Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Would you like an HTML report, or a plain text report?
Enter 'html' for an HTML report, or 'text' for plain text
Defaults to 'html'
Enter value for report_type: html

Type Specified:  html


Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  DB Id    Inst Num DB Name      Instance    Host
------------ -------- ------------ ------------ ------------
* 2100083002        1 TEST        test        even.oracle.
                                                com

Using 2100083002 for database Id
Using          1 for instance number


Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Entering the number of days (n) will result in the most recent
(n) days of snapshots being listed.  Pressing <return> without
specifying a number lists all completed snapshots.


 

Enter value for num_days: 1

Listing the last day's Completed Snapshots

                                                        Snap
Instance    DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
test        TEST                12 20 Dec 2012 10:38      1
                                13 20 Dec 2012 11:17      1
                                14 20 Dec 2012 11:42      1
                                15 20 Dec 2012 11:42      1
                                16 20 Dec 2012 11:42      1
                                17 20 Dec 2012 13:00      1
                                18 20 Dec 2012 13:37      1
                                19 20 Dec 2012 13:50      1
                                20 20 Dec 2012 14:00      1
                                21 20 Dec 2012 14:10      1
                                22 20 Dec 2012 14:20      1
                                23 20 Dec 2012 14:30      1
                                24 20 Dec 2012 14:40      1
                                25 20 Dec 2012 14:50      1
                                26 20 Dec 2012 15:00      1
                                27 20 Dec 2012 15:10      1
                                28 20 Dec 2012 15:20      1
                                29 20 Dec 2012 15:30      1
                                30 20 Dec 2012 15:40      1
                                31 20 Dec 2012 15:50      1
                                32 20 Dec 2012 16:36      1

 

Specify the Begin and End Snapshot Ids

Enter value for begin_snap: 30
Begin Snapshot Id specified: 30

Enter value for end_snap: 32
End  Snapshot Id specified: 32

 

Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_30_32.html.  To use this name,
press <return> to continue, otherwise enter an alternative.

Enter value for report_name: /home/oracle/20121231_AWR_rpt.html
......
.....
......
......
 

Report written to /home/oracle/20121231_AWR_rpt.html

到此AWR report就产生了,我的报表在/home/oracle/20121231_AWR_rpt.html

  • 1
  • 2
  • 下一页

相关内容