1.连接到数据库
C:\Users\zhangjian>sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on 星期四 1月 16 15:33:43 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
SQL> conn /as sysdba
已连接。
2.开始生成报告设置
SQL> @?/rdbms/admin/awrrpt.sql
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
----------- ------------ -------- ------------
224871709 XIZHIMEN 1 xizhimen
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'
3.生成html格式的报告
输入 report_type 的值: html
Type Specified: html
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
------------ -------- ------------ ------------ ------------
* 224871709 1 XIZHIMEN xizhimen KSH-CLU-2
Using 224871709 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.
4.选择一天的数据
输入 num_days 的值: 1
Listing the last day's Completed Snapshots
Instance DB Name Snap Id Snap Started Level
------------ ------------ --------- ------------------ -----
xizhimen XIZHIMEN 56 16 1月 2014 00:00 1
57 16 1月 2014 01:00 1
58 16 1月 2014 02:00 1
59 16 1月 2014 03:00 1
60 16 1月 2014 04:00 1
61 16 1月 2014 05:00 1
62 16 1月 2014 06:00 1
63 16 1月 2014 07:00 1
64 16 1月 2014 08:00 1
65 16 1月 2014 09:00 1
66 16 1月 2014 10:01 1
67 16 1月 2014 11:00 1
68 16 1月 2014 12:00 1
69 16 1月 2014 13:00 1
70 16 1月 2014 14:00 1
71 16 1月 2014 15:00 1
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5.选择时间段 注意:此处不允许出现断点 如上不能选择65-66或65-71之间
输入 begin_snap 的值: 66
Begin Snapshot Id specified: 66
输入 end_snap 的值: 71
End Snapshot Id specified: 71
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_66_71.html. To use this name,
press <return> to continue, otherwise enter an alternative.
6.输入报告的名字
输入 report_name 的值:直接回车
End of Report
</BODY></HTML>
Report written to awrrpt_1_66_71.html
SQL>
7.报告生成在当前用户的根目录下:C:\Users\zhangjian\awrrpt_1_66_71.html