Oracle AWR报告提取方法

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

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

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

3.手工生成一个快照

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

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

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.
时间: 2024-08-25 06:14:56

Oracle AWR报告提取方法的相关文章

(转载)Oracle AWR报告指标全解析

Oracle AWR报告指标全解析 2014-10-16 14:48:04 分类: Oracle [性能调优]Oracle AWR报告指标全解析 2013/08/31 BY MACLEAN LIU 26条评论 [性能调优]Oracle AWR报告指标全解析 开Oracle调优鹰眼,深入理解AWR性能报告:http://www.askmaclean.com/archives/awr-hawk-eyes-training.html 开Oracle调优鹰眼,深入理解AWR性能报告 第二讲: http:

ORACLE AWR报告生成步骤

ORACLE AWR报告生成步骤 (以PL/SQL中命令窗口为例) 1.sqlplus或plsql的commod窗口(命令窗口)运行命令 @D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\awrrpt.sql; -- 具体地址,需要查询得到 --然后在弹出的对话框中输入选择的导出格式html或者txt,一般用html,生成的报告用浏览器查看比较方便. 2.在弹出的对话框中输入数字选择制定选择快照的数量 3.在接下来弹出的对话框中分别选择最小和最大snap_id

Oracle AWR 报告详解

转自:http://blog.csdn.net/laoshangxyc/article/details/8615187 持续更新中... Oracle awr报告详解 DB Name DB Id Instance Inst num Startup Time Release RAC ORCL 1295334343 orcl 1 09-1月 -12 18:01 11.2.0.1.0 NO DB Name :数据库名 DB Id :数据库Id(获取方法select dbid from v$databa

python实现自动生成oracle awr报告

目前在规划.开发性能自动化执行框架,其中有个环节很有意思,就是如何通过框架自动获得场景执行期间的oracle awr报告.虽然Oracle客户端提供的awrrpt.sql脚本可以提供交互方式生成awr报告,但并不能直接使用在自动化框架中,至少需要做一些改造,将交互的模式变成可以静默执行. 一 问题分析 经过对问题的分析,有两种基本的解决思路: A.  在oracle服务器上部署shell脚本,使用shell命令启动oracle的sqlplus执行autoawr.sql,其中autoawr.sql

ORACLE AWR报告数据的导入导出实践

关于AWR的快照数据可以导出.导入,一直没有亲手实践过.今天动手测试了一下如何导出.导入AWR数据,将AWR的数据从一测试服务器,导入到另外一台测试服务器. SQL> @?/rdbms/admin/awrextr.sql ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Disclaimer: T

提取oracle awr报告

做性能测试时有时需要分析sql的执行情况,以找出需要优化的sql,oracle数据库就提供了很好的数据库状态和sql执行情况的监控平台,数据库的监控平台可以时时的监控数据库的状态,同时还可以取监控的时间段生成awr报告,来分析指定时间段的数据库的运行状态. awr报告其实就是取的数据库中两个快照之间数据,形成了一个报告的形式,通过数据的方式更加直观的展示所选两个快照之间数据库的运行状态. awr报告的提取方式我知道的有两种,一种是通过命令行提取,一种是从oracle数据库的控制台中指定两个快照来

[转]oracle awr报告生成和分析

转自:http://blog.csdn.net/cuker919/article/details/8767328 最近由于数据库cpu占用非常高,导致VCS常常自动切换,引起很多问题. 最近学习一下数据库awr分析数据库sql执行性能的分析报告.下面将初步讲解一下: 1.先登陆数据库,生成awr报告. linux:~ # su - oracle[email protected]:~> sqlplus '/as sysdba' SQL*Plus: Release 11.1.0.6.0 - Prod

oracle AWR报告

AWR( Automatic Workload Repository )报告是对oracle的性能评定以及发现问题SQL语句的重要手段. AWR报告的原理是基于oracle数据库的定时镜像功能.默认情况下,Oracle数据库后台进程会以一定间隔(一小时)收集系统当前状态镜像,并且保存在数据库中.生成AWR报告时,只需要指定进行分析的时间段(开始镜像编号和结束镜像编号),就可以生成该时间段的性能分析情况.AWR镜像保存在数据库中的时间为一个月左右. 也可以手工生成一个快照: SQL>dbms_wo

Oracle AWR报告自动生成并ftp脚本

脚本主要由以下几个部分组成: awr.sql 用来在sqlplus 中执行的脚本,该脚本从网上直接找的. awr.sh 用来调用sqlplus来生成awr报告. ftp.sh 用来打包压缩每天生成的awr报告(压缩率大于50倍),并进行ftp传输,清理过期的报告,对于linux和solaris略有不同. crontab 用来执行定时任务,根据需求进行调整. 下面为具体的脚本内容,可以根据需要进行调整. awr.sql : 1 set echo off; 2 set veri off; 3 set