在linux系统下的ORACLE上生成AWR报告

--在linux系统下的ORACLE上生成AWR报告


--具体步骤:
1、找到awrrpt.sql的所在位置
在$ORACLE_HOME/rdbms/admin/awrrpt.sql


2、登录数据库
[oracle@localhost ~]$ sqlplus / as sysdba


3、调用awrrpt.sql
SQL> @$ORACLE_HOME/rdbms/admin/awrrpt.sql


4、输入生成报告类型text或者html
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


5、输入生成报告的天数,默认是7天
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: 7


这里会显示一个最近7天的快照列表:
Listing the last 7 days of Completed Snapshots
                                                       Snap
Instance     DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
orcl         ORCL               995 15 Sep 2014 17:30      1
                                996 15 Sep 2014 19:00      1
                                997 15 Sep 2014 20:00      1
                                998 15 Sep 2014 21:00      1
                                999 16 Sep 2014 08:26      1
                               1000 16 Sep 2014 09:00      1
                               1001 16 Sep 2014 10:00      1
                               1002 16 Sep 2014 11:00      1
                               1003 16 Sep 2014 12:00      1
                               1004 16 Sep 2014 13:00      1
                               1005 16 Sep 2014 14:00      1


                               1006 17 Sep 2014 10:24      1
                               1007 17 Sep 2014 11:00      1
                               1008 17 Sep 2014 12:00      1
                               1009 17 Sep 2014 13:00      1


6、选择起止快照号:
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 995
Begin Snapshot Id specified: 995


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


7、这时候报了错:
ERROR at line 1:
ORA-20200: The instance was shutdown between snapshots 995 and 1009
ORA-06512: at line 42
由于中间本地测试环境关过库。所以只能重新运行awrrpt.sql,选择一段连续时间的快照


8、前面的步骤省略,再次选择快照号:
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 1006
Begin Snapshot Id specified: 1006


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


9、输入awr报告名称,回车选择默认名称awrrpt_1_1006_1009.html
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_1006_1009.html.  To use this name,
press <return> to continue, otherwise enter an alternative.


Enter value for report_name: 


10、生成awr报告
当显示下面的信息,表示已经完成报告
End of Report
</body></html>
Report written to awrrpt_1_1006_1009.html
SQL> 


下面就可以将awr报告copy到本地进行查看了。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值