生成AWR报告的方法步骤
1.生成单实例 AWR 报告:

@$ORACLE_HOME/rdbms/admin/awrrpt.sql

2.生成 Oracle RAC AWR 报告:

@$ORACLE_HOME/rdbms/admin/awrgrpt.sql

3.生成 RAC 环境中特定数据库实例的 AWR 报告:

@$ORACLE_HOME/rdbms/admin/awrrpti.sql

4.生成 Oracle RAC 环境中多个数据库实例的 AWR 报告的方法:

@$ORACLE_HOME/rdbms/admin/awrgrpti.sql

5.生成 SQL 语句的 AWR 报告:

@$ORACLE_HOME/rdbms/admin/awrsqrpt.sql

6.生成特定数据库实例上某个 SQL 语句的 AWR 报告:

@$ORACLE_HOME/rdbms/admin/awrsqrpi.sql

–生成 AWR 时段对比报告
7.生成单实例 AWR 时段对比报告

@$ORACLE_HOME/rdbms/admin/awrddrpt.sql

8.生成 Oracle RAC AWR 时段对比报告

@$ORACLE_HOME/rdbms/admin/awrgdrpt.sql

9.生成特定数据库实例的 AWR 时段对比报告

@$ORACLE_HOME/rdbms/admin/awrddrpi.sql

10.生成 Oracle RAC 环境下特定(多个)数据库实例的 AWR 时段对比报告

@$ORACLE_HOME/rdbms/admin/awrgdrpi.sql

例子1.生成单实例 AWR 报告:

SQL> @?/rdbms/admin/awrrpt.sql

Current Instance

DB Id DB Name Inst Num Instance


1524196319 SXLTFXGL 1 sxltfxgl1

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’

Type Specified:  html

Instances in this Workload Repository schema

DB Id Inst Num DB Name Instance Host


  • 1524196319 1 SXLTFXGL sxltfxgl1 gljceb01
    1524196319 2 SXLTFXGL sxltfxgl2 gljceb02

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

Enter value for num_days: 7

Listing the last 7 days of Completed Snapshots
Instance DB Name Snap Id Snap Started Level


sxltfxgl1 SXLTFXGL 83340 19 Jan 2019 00:00 1


。(前略)



83901 24 Jan 2019 20:15 1
83902 24 Jan 2019 20:30 1
83903 24 Jan 2019 20:45 1
83904 24 Jan 2019 21:00 1
83905 24 Jan 2019 21:15 1
83906 24 Jan 2019 21:30 1
83907 24 Jan 2019 21:45 1
83908 24 Jan 2019 22:00 1
83909 24 Jan 2019 22:15 1
83910 24 Jan 2019 22:30 1
83911 24 Jan 2019 22:45 1
83912 24 Jan 2019 23:00 1
83913 24 Jan 2019 23:15 1
83914 24 Jan 2019 23:30 1
83915 24 Jan 2019 23:45 1
83916 25 Jan 2019 00:00 1
83917 25 Jan 2019 00:15 1
83918 25 Jan 2019 00:30 1
83919 25 Jan 2019 00:45 1
83920 25 Jan 2019 01:00 1
83921 25 Jan 2019 01:15 1
83922 25 Jan 2019 01:30 1
83923 25 Jan 2019 01:45 1
83924 25 Jan 2019 02:00 1
83925 25 Jan 2019 02:15 1
83926 25 Jan 2019 02:30 1
83927 25 Jan 2019 02:45 1
83928 25 Jan 2019 03:00 1
83929 25 Jan 2019 03:15 1
83930 25 Jan 2019 03:30 1
83931 25 Jan 2019 03:45 1
83932 25 Jan 2019 04:00 1
83933 25 Jan 2019 04:15 1
83934 25 Jan 2019 04:30 1
83935 25 Jan 2019 04:45 1
83936 25 Jan 2019 05:00 1
83937 25 Jan 2019 05:15 1
83938 25 Jan 2019 05:30 1
83939 25 Jan 2019 05:45 1
83940 25 Jan 2019 06:00 1
83941 25 Jan 2019 06:15 1
83942 25 Jan 2019 06:30 1
83943 25 Jan 2019 06:45 1
83944 25 Jan 2019 07:00 1
83945 25 Jan 2019 07:15 1
83946 25 Jan 2019 07:30 1
83947 25 Jan 2019 07:45 1
83948 25 Jan 2019 08:00 1
83949 25 Jan 2019 08:15 1
83950 25 Jan 2019 08:30 1
83951 25 Jan 2019 08:45 1
83952 25 Jan 2019 09:00 1
83953 25 Jan 2019 09:15 1
83954 25 Jan 2019 09:30 1
83955 25 Jan 2019 09:45 1
nstance DB Name Snap Id Snap Started Level


sxltfxgl1 SXLTFXGL 83956 25 Jan 2019 10:00 1
83957 25 Jan 2019 10:15 1
83958 25 Jan 2019 10:30 1
83959 25 Jan 2019 10:45 1
83960 25 Jan 2019 11:00 1
83961 25 Jan 2019 11:15 1
83962 25 Jan 2019 11:30 1
83963 25 Jan 2019 11:45 1
83964 25 Jan 2019 12:00 1
83965 25 Jan 2019 12:15 1
83966 25 Jan 2019 12:30 1
Specify the Begin and End Snapshot Ids

Enter value for begin_snap: 83852

Begin Snapshot Id specified: 83852

Enter value for end_snap: 83948

End Snapshot Id specified: 83948

Specify the Report Name

The default report file name is awrrpt_1_83852_83948.html. To use this name,
press to continue, otherwise enter an alternative.

Enter value for report_name: /tmp/testawr.html

Using the report name /tmp/testawr.html

生成过程略。。。。

Report written to /tmp/testawr.html

SQL> ho ls /tmp

hsperfdata_oracle keyring-9bDf7W lost+found pulse-2kDTmzi8jxIy pulse-Hc6nLPSAUXiT
testawr.html (已生成)
vmware-tools-distrib
keyring-0ZNP0g keyring-dDynXx orbit-gdm pulse-dcaODSPxfsd6 pulse-O8D9GFXxUEA9 VMwareTools-9.4.10-2092844.tar.gz

例子2.生成 Oracle RAC AWR 报告:

SQL> @?/rdbms/admin/awrgrpt.sql

Current Database

DB Id DB Name


1524196319 SXLTFXGL

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 INSTT_NUM DB Name INSTT_NAME Host


  • 1524196319 1 SXLTFXGL sxltfxgl1 gljceb01
  • 1524196319 2 SXLTFXGL sxltfxgl2 gljceb02

Using 1524196319 for database Id
Using instances ALL (default ‘ALL’)

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.

Enter value for num_days: 3

Listing the last 3 days of Completed Snapshots
DB Name Snap Id Snap Started Level


。。。。。前略
83949 25 Jan 2019 08:15 1
83950 25 Jan 2019 08:30 1
83951 25 Jan 2019 08:45 1
83952 25 Jan 2019 09:00 1
83953 25 Jan 2019 09:15 1
83954 25 Jan 2019 09:30 1
83955 25 Jan 2019 09:45 1
83956 25 Jan 2019 10:00 1
83957 25 Jan 2019 10:15 1
83958 25 Jan 2019 10:30 1
83959 25 Jan 2019 10:45 1
83960 25 Jan 2019 11:00 1
83961 25 Jan 2019 11:15 1
83962 25 Jan 2019 11:30 1
83963 25 Jan 2019 11:45 1
83964 25 Jan 2019 12:00 1
83965 25 Jan 2019 12:15 1
83966 25 Jan 2019 12:30 1
83967 25 Jan 2019 12:45 1

Specify the Begin and End Snapshot Ids

Enter value for begin_snap: 83948

Begin Snapshot Id specified: 83948

Enter value for end_snap: 83964

End Snapshot Id specified: 83964

Specify the Report Name

The default report file name is awrrpt_rac_83948_83964.html. To use this name,
press to continue, otherwise enter an alternative.

Enter value for report_name: test2awr.html

Using the report name test2awr.html

生成过程略。。。
Report written to test2awr.html

[oracle@gljceb01 /]$ cd /home/oracle
[oracle@gljceb01 ~]$ ls -l test*

-rw-r–r-- 1 oracle oinstall 640697 Jan 25 12:53 test2awr.html

如何简单分析awr报告(参考,转载)

mysql的awr报告每列的含义 mysql awr报告生成_SQL


DB Name :数据库名字 DBid: 数据库id

DB Time不包括Oracle后台进程消耗的时间。如果DB Time远远小于Elapsed时间,说明数据库比较空闲。在31分钟里,数据库耗时0.1分钟,数据中显示系统有2个CPU

Load Profile

mysql的awr报告每列的含义 mysql awr报告生成_sql_02


mysql的awr报告每列的含义 mysql awr报告生成_sql_03

Per Second Per Transaction
这两部分是数据库资源负载的一个明细列表,分割成每秒钟的资源负载和每个事务的资源负载情况,性能指标的含义如下:
redo size: 每秒/每个事务 产生的redo量 (单位字节)
logical reads: 每秒/每个事务 产生的逻辑读的块数
block changes: 每秒/每个事务 改变的数据块数
physical reads: 每秒/每个事务 产生的物理读
physical writes: 每秒/每个事务 产生的物理写的块数
user calls: 每秒/每个事务 用户的调用次数
parses: 每秒/每个事务 分析次数
hard parses: 每秒/每个事务 硬分析次数
sorts: 每秒/每个事务 排序次数
logons: 每秒/每个事务 登录数据库次数
executes: 每秒/每个事务 SQL的执行次数
rollbacks: 每秒/每个事物回滚次数
transactions: 每秒的事务数
Instance Efficiency Percentages (Target 100%)

Instance Efficiency Percentages (Target 100%)

mysql的awr报告每列的含义 mysql awr报告生成_Time_04

Buffer Nowait:表示在内存获得数据的未等待比例。
buffer hit:表示进程从内存中找到数据块的比率,内存数据块命中率
Redo NoWait:表示在LOG缓冲区获得BUFFER的未等待比例。
library hit:表示共享池中SQL解析的命中率
Latch Hit:Latch是一种保护内存结构的锁,可以认为是SERVER进程获取访问内存数据结构的许可。
Parse CPU to ParseElapsd:解析总时间中消耗总CPU的时间百分比
Non-Parse CPU :SQL实际运行时间/(SQL实际运行时间+SQL解析时间),太低表示解析消耗时间过多。
Execute to Parse:是语句执行与分析的比例,如果要SQL重用率高,则这个比例会很高。该值越高表示一次解析后被重复执行的次数越多。
In-memory Sort:在内存中排序的比率,如果过低说明有大量的排序在临时表空间中进行。考虑调大PGA。
Soft Parse:软解析的百分比(softs/softs+hards),近似当作sql在共享区的命中率,太低则需要调整应用使用绑定变量

Shared Pool Statistics

mysql的awr报告每列的含义 mysql awr报告生成_mysql的awr报告每列的含义_05


Memory Usage %:对于一个已经运行一段时间的数据库来说,共享池内存使用率,应该稳定在75%-90%间,如果太小,说明Shared Pool有浪费,而如果高于90,说明共享池中有争用,内存不足。

SQL with executions>1:执行次数大于1的sql比率,如果此值太小,说明需要在应用中更多使用绑定变量,避免过多SQL解析。

Memory for SQL w/exec>1:执行次数大于1的SQL消耗内存的占比。

Top 5 Timed Foreground Events

mysql的awr报告每列的含义 mysql awr报告生成_Time_06


这是报告概要的最后一节,显示了系统中最严重的5个等待,按所占等待时间的比例倒序列示。当我们调优时,总希望观察到最显著的效果,因此应当从这里入手确定我们下一步做什么。

通常,在没有问题的数据库中,CPUtime总是列在第一个

二、解析报告(SQL Statistics)

• SQL ordered by Elapsed Time
• SQL ordered by CPU Time
• SQL ordered by User I/O Wait Time
• SQL ordered by Gets
• SQL ordered by Reads
• SQL ordered by Physical Reads (UnOptimized)
• SQL ordered by Executions
• SQL ordered by Parse Calls
• SQL ordered by Sharable Memory
• SQL ordered by Version Count
• Complete List of SQL Text

1.SQL ordered by Elapsed Time:
记录了执行总和时间的TOP SQL(请注意是监控范围内该SQL的执行时间总和,而不是单次SQL执行时间 Elapsed Time = CPU Time + Wait Time)
Elapsed Time(S): SQL语句执行用总时长,此排序就是按照这个字段进行的。注意该时间不是单个SQL跑的时间,而是监控范围内SQL执行次数的总和时间。单位时间为秒。Elapsed Time = CPU Time + Wait Time
CPU Time(s): 为SQL语句执行时CPU占用时间总时长,此时间会小于等于Elapsed Time时间。单位时间为秒。
Executions: SQL语句在监控范围内的执行次数总计。
Elap per Exec(s): 执行一次SQL的平均时间。单位时间为秒。
% Total DB Time: 为SQL的Elapsed Time时间占数据库总时间的百分比。
SQL ID: SQL语句的ID编号,点击之后就能导航到下边的SQL详细列表中,点击IE的返回可以回到当前SQL ID的地方。
SQL Module: 显示该SQL是用什么方式连接到数据库执行的,如果是用SQL*Plus或者PL/SQL链接上来的那基本上都是有人在调试程序。一般用前台应用链接过来执行的sql该位置为空。
SQL Text: 简单的sql提示,详细的需要点击SQL ID。
2. SQL ordered by CPU Time:
记录了执行占CPU时间总和时间最长的TOP SQL(请注意是监控范围内该SQL的执行占CPU时间总和,而不是单次SQL执行时间)。
3. SQL ordered by Gets:
记录了执行占总buffer gets(逻辑IO)的TOP SQL(请注意是监控范围内该SQL的执行占Gets总和,而不是单次SQL执行所占的Gets).
4. SQL ordered by Reads:
记录了执行占总磁盘物理读(物理IO)的TOP SQL(请注意是监控范围内该SQL的执行占磁盘物理读总和,而不是单次SQL执行所占的磁盘物理读)。
5. SQL ordered by Executions:
记录了按照SQL的执行次数排序的TOP SQL。该排序可以看出监控范围内的SQL执行次数。
6. SQL ordered by Parse Calls:
记录了SQL的软解析次数的TOP SQL。
7. SQL ordered by Sharable Memory:
记录了SQL占用library cache的大小的TOP SQL。
Sharable Mem (b):占用library cache的大小。单位是byte。
8. SQL ordered by Version Count:
记录了SQL的打开子游标的TOP SQL。