AWR是在10G开始引入的,在以前可以使用Statspack;AWR的前身就是Statspack;
手动生成AWR报告,可以使用$ORACLE_HOME/rdbms/admin/awrrpt.sql;linux貌似是在dbs目录
(1)用管理员账号登陆,sys
(2)所选快照距离现在的天数
(3)生成报表的起始快照编号
(4)生成报表的结束快照编号
(5)输入报表名称
--首先用sys登陆,可以去服务端登陆、也可以在客户端登陆、这里用的客户端
--windows在rdbms目录;linux貌似在dbs目录
SQL> @\\192.168.1.6\f$\oracle\product\10.2.0\db_1\RDBMS\ADMIN\awrrpt.sql
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
----------- ------------ -------- ------------
1346908926 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'
输入 report_type 的值:html
---这里输出html格式的数据
Type Specified: html
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
------------ -------- ------------ ------------ ------------
* 1346908926 1 ORCL orcl SYOA20130626
Using 1346908926 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.
--这里显示最近7天的快照信息
输入 num_days 的值:7
<<中间会显示一些快照信息、这里省略........>>
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--输入开始快照ID;可以从上面省略的输出信息查看
输入 begin_snap 的值: 547
Begin Snapshot Id specifie
--输入结束快照ID;可以从上面省略的输出信息查看
输入 end_snap 的值: 703
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_547_703.html. To use this name,
press <return> to continue, otherwise enter an alternative.
--输入保存的文件路径;如果采用的客户端登陆,就写客户端的路径;否则就写服务端的路径
输入 report_name 的值:C:\123456.html
--------------------------------------------下面是输出的示例报告--------------------------------------------------------------------------------------