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

Oracle AWR报告提取方法

时间:2014-10-20 21:18:52      阅读:244      评论:0      收藏:0      [点我收藏+]

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

本文旨在用来指导项目人员自行提取Oracle数据库的AWR报告.

1.当前连接实例的AWR报告提取:@?/rdbms/admin/awrrpt

SQL> @?/rdbms/admin/awrrpt

Current Instance
~~~~~~~~~~~~~~~~

   DB Id    DB Name      Inst Num Instance
----------- ------------ -------- ------------
  857123342 JY                  1 jy1


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: 

Type Specified:  html


Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   DB Id     Inst Num DB Name      Instance     Host
------------ -------- ------------ ------------ ------------
  857123342         2 JY           jy2          rac2-server
* 857123342         1 JY           jy1          rac1-server

Using  857123342 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.


Enter value for num_days: 1

Listing the last days Completed Snapshots

                                                        Snap
Instance     DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
jy1          JY                  92 16 Oct 2014 07:32      1
                                 93 16 Oct 2014 09:00      1
                                 94 16 Oct 2014 10:00      1
                                 95 16 Oct 2014 11:00      1



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

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



Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_94_95.html.  To use this name,
press <return> to continue, otherwise enter an alternative.

Enter value for report_name: 

Using the report name awrrpt_1_94_95.html

此处省略大量屏幕输出..
End of Report </BODY></HTML> Report written to awrrpt_1_94_95.html SQL> !pwd /home/oracle

注:生成的报告文件发送给我即可,例如此处就是指awrrpt_1_94_95.html文件,代表的是2014年10月16日10点~11点这一小时的数据库实例jy1的工作负载报告。

 

2.RAC的其他实例AWR报告提取:@?/rdbms/admin/awrrpti

SQL> @?/rdbms/admin/awrrpti

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: 

Type Specified:  html


Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   DB Id     Inst Num DB Name      Instance     Host
------------ -------- ------------ ------------ ------------
  857123342         2 JY           jy2          rac2-server
* 857123342         1 JY           jy1          rac1-server

Enter value for dbid: 857123342
Using 857123342 for database Id
Enter value for inst_num: 2
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: 

Listing all Completed Snapshots

                                                        Snap
Instance     DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
jy2          JY                  91 14 Oct 2014 10:10      1

                                 92 16 Oct 2014 07:32      1
                                 93 16 Oct 2014 09:00      1
                                 94 16 Oct 2014 10:00      1
                                 95 16 Oct 2014 11:00      1

 

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

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

 

Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_2_94_95.html.  To use this name,
press <return> to continue, otherwise enter an alternative.

Enter value for report_name: 

Using the report name awrrpt_2_94_95.html

此处省略大量屏幕输出..

End of Report
</BODY></HTML>
Report written to awrrpt_2_94_95.html

 

3.手工生成一个快照:

exec dbms_workload_repository.create_snapshot();
SQL> exec dbms_workload_repository.create_snapshot();

PL/SQL procedure successfully completed.

 

Oracle AWR报告提取方法

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

原文地址:http://www.cnblogs.com/jyzhao/p/4030022.html

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