当前位置:Gxlcms > mysql > 通过案例学调优之--AWRbaseline对比生成AWR报告

通过案例学调优之--AWRbaseline对比生成AWR报告

时间:2021-07-01 10:21:17 帮助过:35人阅读

通过案例学调优之--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:

wKiom1RZ7JOBmPF9AAOrgbV8-cU563.jpg


通过OEM创建AWR Baseline

wKiom1RZ7JOgwd_BAAMu6NqONds323.jpg


选择AWR基线


wKioL1RZ7PbQpWGFAAMBHVtXAhI706.jpg


创建单一基线

wKiom1RZ7JSjK6V2AAPwteDWwxI359.jpg


选择创建基线的时间段(snap_id)

wKioL1RZ7PaB6oCSAARGRFEMx5g462.jpg

wKiom1RZ7JSgsAnIAANHN5MZxZY213.jpg



查看生成的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.

wKioL1RZ7PexDxEPAAOPGS3j5nE910.jpg


建立和Baseline对比的AWR report

wKiom1RZ7JXDp3eIAALLKy3yNkM068.jpg

选择和基线对比的snap_id


wKioL1RZ7Pjg_3cKAAHrXGCGjAg468.jpg


生成对比报告

wKiom1RZ7JbTt9-iAAQHKPKTFQA781.jpg

wKioL1RZ7PixUU2mAANP7vKbk7M326.jpg

wKiom1RZ7JbijUanAALQzXlQtGg189.jpg




对比报告信息

人气教程排行