通过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/