通过案例学调优之--AWRBaseline对比生成AWR报告本案例是通过建立AWRBaseline,然后选择不同时段建立AWRreport进行对比,对数据库性能变化进行监控和对比。一、建
通过案例学调优之--AWR Baseline对比生成AWR报告
本案例是通过建立AWR Baseline,然后选择不同时段建立AWR report进行对比,对数据库性能变化进行监控和对比。
一、建立Baseline
查看snapshot:
16:46:08 SYS@ prod >select SNAP_ID,BEGIN_INTERVAL_TIME from dba_hist_snapshot; SNAP_ID BEGIN_INTERVAL_TIME ---------- --------------------------------------------------------------------------- 117 04-NOV-14 02.02.31.757 AM 118 04-NOV-14 03.00.11.848 AM 116 04-NOV-14 02.01.49.722 AM 120 04-NOV-14 04.00.22.865 AM 119 04-NOV-14 03.32.20.955 AM建立Baseline:
通过OEM创建AWR Baseline
选择AWR基线
创建单一基线
选择创建基线的时间段(snap_id)
查看生成的AWR基线报告
建立当前时段下的snapshot:
1、建立起始snapshot
16:46:25 SYS@ prod >exec dbms_workload_repository.create_snapshot();
PL/SQL procedure successfully completed. 16:52:27 SYS@ prod >select SNAP_ID,BEGIN_INTERVAL_TIME from dba_hist_snapshot; SNAP_ID BEGIN_INTERVAL_TIME ---------- --------------------------------------------------------------------------- 117 04-NOV-14 02.02.31.757 AM 118 04-NOV-14 03.00.11.848 AM 116 04-NOV-14 02.01.49.722 AM 121 05-NOV-14 04.43.00.000 PM 120 04-NOV-14 04.00.22.865 AM 119 04-NOV-14 03.32.20.955 AM 6 rows selected. 模拟数据库运行环境,建立负载: 16:55:01 SCOTT@ prod >begin 16:55:14 2 for i in 1..100000 loop 16:55:25 3 execute immediate 'insert into tb1 (id) values ('||i||')'; 16:55:31 4 end loop; 16:55:34 5 end; 16:55:35 6 / PL/SQL procedure successfully completed. 建立结束snapshot: 16:52:35 SYS@ prod >exec dbms_workload_repository.create_snapshot(); PL/SQL procedure successfully completed. 16:56:36 SYS@ prod >select SNAP_ID,BEGIN_INTERVAL_TIME from dba_hist_snapshot; SNAP_ID BEGIN_INTERVAL_TIME ---------- --------------------------------------------------------------------------- 117 04-NOV-14 02.02.31.757 AM 118 04-NOV-14 03.00.11.848 AM 116 04-NOV-14 02.01.49.722 AM 121 05-NOV-14 04.43.00.000 PM 122 05-NOV-14 04.52.16.563 PM 120 04-NOV-14 04.00.22.865 AM 119 04-NOV-14 03.32.20.955 AM 7 rows selected.建立和Baseline对比的AWR report
选择和基线对比的snap_id
生成对比报告
对比报告信息