AWR报告提取(ORACLE10G RAC+AIX53)
1、如果不在oracle用户下请切换到oracle用户
su - oracle
2、以sysdba权限登录数据库
sqlplus "/as sysdba"
3、执行awrprt命令
SQL> @?/rdbms/admin/awrrpt
4、出现选择awr的输出格式界面(默认选HTML比较直观)
-----------------------------------------------
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
----------- ------------ -------- ------------
2566595041 samp 2 samp2
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
-----------------------------------------------
5、选择采集日期间隔(下述samp1\samp2是RAC节点的两个实例)
-----------------------------------------------
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
------------ -------- ------------ ------------ ------------
* 2566595041 2 samp samp2 p650b
2566595041 1 samp samp1 p650a
Using 2566595041 for database Id
Using 2 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
------------------------------------------------
6、选择开始和结束采集点30132-30148
------------------------------------------------
Listing the last day's Completed Snapshots
Snap
Instance DB Name Snap Id Snap Started Level
------------ ------------ --------- ------------------ -----
samp2 samp 30132 13 Aug 2010 00:00 1
30133 13 Aug 2010 01:00 1
30134 13 Aug 2010 02:00 1
30135 13 Aug 2010 03:00 1
30136 13 Aug 2010 04:00 1
30137 13 Aug 2010 05:00 1
30138 13 Aug 2010 06:00 1
30139 13 Aug 2010 07:00 1
30140 13 Aug 2010 08:00 1
30141 13 Aug 2010 09:00 1
30142 13 Aug 2010 10:00 1
30143 13 Aug 2010 11:00 1
30144 13 Aug 2010 12:00 1
30145 13 Aug 2010 13:00 1
30146 13 Aug 2010 14:00 1
30147 13 Aug 2010 15:00 1
30148 13 Aug 2010 16:00 1
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 30132
Begin Snapshot Id specified: 30132
Enter value for end_snap: 30148
End Snapshot Id specified: 30148
------------------------------------------------
7、指定输出地址和名称/tmp/awrrpt_2_30132_30148.html
------------------------------------------------
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_2_30132_30148.html. To use this name,
press <return> to continue, otherwise enter an alternative.
Enter value for report_name: /tmp/awrrpt_2_30132_30148.html
------------------------------------------------
8、生成过程----屏幕打印一堆html代码
------------------------------------------------
Using the report name /tmp/awrrpt_2_30132_30148.html
<HTML><HEAD><TITLE>AWR Report</TITLE><style type="text/css">body.awr {font:bold 10pt Arial,Helvetica,Geneva,sans-serif;color:black; background:White;}
9、结束生成过程
------------------------------------------------
End of Report
</BODY></HTML>
Report written to /tmp/awrrpt_2_30132_30148.html
SQL>
------------------------------------------------
10、到指定目录下/tmp/取出awrrpt_2_30132_30148.html,在IE等浏览器打开就可以阅读了。
本文转自zylhsy 51CTO博客,原文链接:http://blog.51cto.com/yunlongzheng/373638,如需转载请自行联系原作者