数据库性能对比报告小技巧

比如我现在做的迁移前后io性能对比报告,

刚开始我也是没头绪,借鉴了前人的报告,再加上自己的思考就可以做出一份比较漂亮的报告了

首先可以考虑awr报告,取迁移前后同一时段的awr报告进行对比

在wait class中有user io


foreground wait event中的dbfile sequential read,db file scattered read


background 中dbfile parallel write,log file parallel write


这些都可以进行平行对比。

然后还可以查询sql iowait做出折线图

比如

--从结果中找到几个io wait比较高的sql

 select * from (select sql_id,IOWAIT_DELTA from dba_hist_sqlstat where INSTANCE_NUMBER=1  order by IOWAIT_DELTA desc) where rownum<=50 

--通过sqlid找到没个snap的io wait值

set pagesize 2000

set echo off

select b.end_interval_time,a.IOWAIT_DELTA/power(10,6) s from dba_hist_sqlstat a,dba_hist_snapshot b  

where a.snap_id=b.snap_id and a.INSTANCE_NUMBER=b.INSTANCE_NUMBER and a.INSTANCE_NUMBER=1  and a.sql_id='&sql_id' order by b.end_interval_time ;


然后把数据插入表格中,通过插入折线图就可以生成图像。

折线图就可以明显看出io wait有较大提升




猜你喜欢

转载自blog.csdn.net/qq_40687433/article/details/80488700