码迷,mamicode.com
首页 > 数据库 > 详细

Oracle 获取awr报告

时间:2014-11-21 00:10:23      阅读:358      评论:0      收藏:0      [点我收藏+]

标签:style   ar   color   os   使用   sp   for   文件   数据   

1 登录Oracle用户

 su - oracle

2 进入 SQLplus ,扫行 @awrrpt.sql .这里注意,要指定 awrrpt.sql脚本路径,所以建议一开始就进到指定目录这样方便些

cd /u01/app/oracle/product/11.2.0/db_1/rdbms/admin/

这里有个小技巧,  admin下有很多脚本,用于生成不出的报告, 比如 ashrpt.sql  用于生成 ASH报告. 文件名是用 报告名称缩写+rpt.sql 方式命名的.

3 指定报告格式和时间范围,这里分四次输入

第一次指定格式,这里使用html格式.

第二次指定日期范围,这里选当天的.注意了,因为这些数据占空间较大,一般不建议保留太久.我们这边保留了两天的.

第三次指定时间段

第四次指定文件名


最后很多人都会注意到在 SSH 下输入命令,一旦输入错误,没办法使用 Background 按键.这是因为sqlplus编码格式的原因.可以使用 ctrl+Background 的方式一次删两个字符...将就着用

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

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

                              17950 20 Nov 2014 20:00      1
                              17951 20 Nov 2014 21:00      1



Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 17950
Begin Snapshot Id specified: 17950

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

4 之后生成的文件以 文件名+.lst 的方式生成了.直接用浏览器打开就行了.

5 如果使用了数据库集群,那么任意哪个服务器上都能取到完整的AWR报告,因为数据是在集群中的.

Oracle 获取awr报告

标签:style   ar   color   os   使用   sp   for   文件   数据   

原文地址:http://my.oschina.net/zhouxiang/blog/346972

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!