视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
OracleAWR报告生成步骤
2020-11-09 12:35:16 责编:小采
文档


Oracle AWR 是通过对比两次快照(snapshot)收集到的统计信息,来生成报表数据,生成的报表包括多个部分,这点与Statspack生成的报

Oracle AWR 是通过对比两次快照(snapshot)收集到的统计信息,来生成报表数据,,生成的报表包括多个部分,这点与Statspack生成的报告非常类似。不过AWR在生成报告时,可以选择生成TXT或HTML两种格式的报告,相对来说,HTML更利于阅读,而TXT的适用性更广(即使在不能使用浏览器的机器上也能看)。

Oracle AWR报告生成与查看

在CentOS 6.4下安装Oracle 11gR2(x)

Oracle 11gR2 在VMWare虚拟机中安装步骤

Debian 下 安装 Oracle 11g XE R2

操作过Statspack的朋友都还记的,生成报告使用$ORACLE_HOME/rdbms/admin/spreport.sql脚本,到了AWR这片,操作步骤基本上相同,不过生成报告的脚本多了很多选择,包括:
•awrrpt.sql :生成指定快照区间的统计报表;
•awrrpti.sql :生成指定数据库实例,并且指定快照区间的统计报表;
•awrsqlrpt.sql :生成指定快照区间,指定SQL语句(实际指定的是该语句的SQLID)的统计报表;
•awrsqrpi.sql :生成指定数据库实例,指定快照区间的指定SQL语句的统计报表;
•awrddrpt.sql :指定两个不同的时间周期,生成这两个周期的统计对比报表;
•awrddrpi.sql :指定数据库实例,并指定两个的不同时间周期,生成这两个周期的统计对比报表;

报表的生成流程如下:

(1)进入命令行,切换到自己的工作目录:

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator>d:

D:\>

说明:此处切换目录是为了设定生成报表文件的存放位置。

(2)使用sqlplus命令行工具登录连接数据库

Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

D:\>sqlplus /nolog

SQL*Plus: Release 10.1.0.2.0 - Production on 星期四 5月 20 16:48:19 2010

Copyright (c) 1982, 2004, Oracle. All rights reserved.

SQL> conn studydb/studydb@studydb

Connected.
SQL>

(3)运行生成报表SQL文件:@D:\oracle\product\10.1.0\Db_1\RDBMS\ADMIN\awrrpt.sql

SQL> @D:\oracle\product\10.1.0\Db_1\RDBMS\ADMIN\awrrpt.sql

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

DB Id DB Name Inst Num Instance
----------- ------------ -------- ------------
25148485 STUDYDB 1 studydb

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
------------ -------- ------------ ------------ ------------
* 25148485 1 STUDYDB studydb MIN

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



Listing the last 3 days of Completed Snapshots

Snap
Instance DB Name Snap Id Snap Started Level
------------ ------------ --------- ------------------ -----
studydb STUDYDB 271 19 5月 2014 14:15 1

272 19 5月 2014 15:00 1
273 19 5月 2014 16:00 1
274 19 5月 2014 17:00 1
275 19 5月 2014 18:00 1

276 20 5月 2014 09:03 1
277 20 5月 2014 10:00 1
278 20 5月 2014 11:00 1

279 20 5月 2014 14:09 1
280 20 5月 2014 15:00 1
281 20 5月 2014 16:01 1



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

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



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

Enter value for report_name: //输入生成的文件名称默认值为:awrrpt_1_279_281.html

.........................//生成过程省略

End of Report

Report written to awrrpt_1_279_281.html
SQL>

(4)报表生成完成

本文永久更新链接地址:

下载本文
显示全文
专题