前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Oracle AWR报告提取方法

Oracle AWR报告提取方法

作者头像
Alfred Zhao
发布2019-05-24 20:15:57
9660
发布2019-05-24 20:15:57
举报

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

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

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

3.手工生成一个快照

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

代码语言:javascript
复制
SQL> @?/rdbms/admin/awrrpt

//注意输入的@?/rdbms/admin/awrrpt 中间没有任何空格,需要在数据库服务器上Oracle用户登陆,sqlplus / as sysdba 进入SQL> 下执行.
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: 
//注意这里直接回车即可,默认就是html格式的
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
//注意这里根据实际需要选择几天的AWR报告,一般取最近的AWR报告选择1天即可

Listing the last day's 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

//注意这里输入的begin_snap 和 end_snap都是根据上面具体时间点对应的实际Snap Id那一列决定的. 比如我要选 09:00 - 10:00的话,那起始就应该是93和94. 

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

代码语言:javascript
复制
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.手工生成一个快照:

代码语言:javascript
复制
exec dbms_workload_repository.create_snapshot();
代码语言:javascript
复制
SQL> exec dbms_workload_repository.create_snapshot();

PL/SQL procedure successfully completed.
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2014-10-20 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1.当前连接实例的AWR报告提取:@?/rdbms/admin/awrrpt
  • 2.RAC的其他实例AWR报告提取:@?/rdbms/admin/awrrpti
  • 3.手工生成一个快照:
相关产品与服务
数据库
云数据库为企业提供了完善的关系型数据库、非关系型数据库、分析型数据库和数据库生态工具。您可以通过产品选择和组合搭建,轻松实现高可靠、高可用性、高性能等数据库需求。云数据库服务也可大幅减少您的运维工作量,更专注于业务发展,让企业一站式享受数据上云及分布式架构的技术红利!
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档