AWR报告生成方法

AWR 是 Oracle  10g 后推出的新特性, 全称叫Automatic Workload Repository-自动负载信息库, AWR 是通过对比两次快照(snapshot)收集到的统计信息
通过AWR报告, 我们可以进行日常数据库性能评定、发现有问题 SQL等等。

生成AWR报告的脚本路径:$ORACLE_HOME/rdbms/admin/awrrpt.sql

运行脚本:
在sqlplus下
SQL> @?/rdbms/admin/awrrpt.sql

Current Instance
~~~~~~~~~~~~~~~~
       DB Id        DB Name Inst Num   Instance
------------------ ------------ ------------ ------------
 2694191837     ORCL           1            ORCL

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

 

手工生成的时候,需要确认生成AWR报告的时间范围。一般情况下,设置1-7天就可以了

Type Specified:                  html
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   DB Id     Inst Num DB Name      Instance     Host
------------ -------- ------------ ------------ ------------
* 2694191837        1 ORCL          ORCL         redhat4

Using 2694191837 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 without
specifying a number lists all completed snapshots.

Enter value for num_days: 2    //指定天数范围

Listing the last 2 days of Completed Snapshots
                                                       Snap
Instance     DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
ORCL            ORCL          12 31 Aug 2013 13:05      1
                                 13 31 Aug 2013 14:00      1
                                 14 31 Aug 2013 15:00      1
                                 15 31 Aug 2013 16:00      1

                                 16 31 Aug 2013 17:07      1
                                 17 31 Aug 2013 18:00      1
                                 18 31 Aug 2013 19:00      1
                                 19 31 Aug 2013 20:00      1
                                 20 31 Aug 2013 21:00      1
                                 21 31 Aug 2013 22:00      1
                                 22 31 Aug 2013 23:00      1
                                 23 01 Sep 2013 00:01      1
根据列出的时间范围,输入开始和结束的Snap Id
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 22
Begin Snapshot Id specified: 22

Enter value for end_snap: 23

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

Enter value for report_name:  //指定报表路径和名称 一般默认就行,就是在当前路径生成awrrpt_1_22_23.html的报表

生成过程省略...
End of Report

转载于:http://blog.itpub.net/27500440/viewspace-1132814/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值