AWR 报告详细分析 AWR 是 Oracle 10g 版本 推出的新特性, 全称叫Automatic Workload Repository-自动负载信息库, AWR 是通过对比两次快,照(snapshot)收集到的统计信息,来生成报表数据,生成的报表包括多个部分。 WORKLOAD REPOSITORY report for DB Name DB Id Instance Inst nu m Release RAC Host ICCI 1314098396 ICCI1 1 10.2.0.3.0 YES HPGICCI1 Snap Id Snap Time Sessions Cu rsors/Session Begin Snap: 2678 25-Dec-08 14:04:50 24 1.5 End Snap: 2680 25-Dec-08 15:23:37 26 1.5 Elapsed: 78.79 (mins) DB Time: 11.05 (mins) DB Time 不包括Oracle 后台进程消耗的时间。如果 DB Time 远远小于 Elapsed时间,说明数据库比较空闲。 db time= cpu time + w ait time(不包含空闲等待) (非后台进程) 说白了就是db time 就是记录的服务器花在数据库运算(非后台进程)和等待(非空闲等待)上的时间 DB time = cpu time + all of nonidle w ait event time 在 79 分钟里(其间收集了 3 次快照数据),数据库耗时 11 分钟,RDA 数据中显示系统有 8 个逻辑 CPU(4 个物理 CPU),平均每个CPU 耗时 1.4 分钟,CPU 利用率只有大约 2%(1.4/79)。说明系统压力非常小。 列出下面这两个来做解释: Report A: Snap Id Snap Time Sessions Curs/Sess --------- ------------------- -------- --------- Begin Snap: 4610 24-Jul-08 22:00:54 68 19.1 End Snap: 4612 24-Jul-08 23:00:25 17 1.7 Elapsed: 59.51 (mins) DB Time: 466.37 (mins) Report B: Snap Id Snap Time Sessions Curs/Sess --------- ------------------- -------- --------- Begin Snap: 3098 13-Nov-07 21:00:37 39 13.6 End Snap: 3102 13-Nov-07 22:00:15 40 16.4 Elapsed: 59.63 (mins) DB Time: 19.49 (mins) 服务器是AIX 的系统,4 个双核 cpu,共 8 个核: /sbin> bindprocessor -q The available processors are: 0 1 2 3 4 5 6 7 先说 Report A,在 snapshot 间隔中,总共约 60 分钟,cpu 就共有 60*8=480 分钟,DB time为 466.37 分钟,则: cpu 花费了 466.37 分钟在处理 Oralce 非空闲等待和运算上(比方逻辑读) 也就是说 cpu 有 ...