Using the AWR History Tables to compare performance

来源:互联网 发布:电脑学钢琴软件 编辑:程序博客网 时间:2024/06/08 14:08

Using the DBA_HIST AWR history tables, we can compare the top wait events between different days or different time periods.

Let us assume that we find that batch jobs which are executed at night particularly between 1 and 2 AM are experiencing performance issues.

In this case we are comparing performance of a particular database on the 17th and 18st of October for the time periods 01:00 to 02:00.

SQL> select snap_id,to_char(BEGIN_INTERVAL_TIME,'dd-mon-yy hh24:mi:ss') "Runtime"
  2  from dba_hist_snapshot
  3  where trunc(BEGIN_INTERVAL_TIME)='18-oct-11' order by snap_id;

   SNAP_ID Runtime
---------- ---------------------
     55171 18-oct-11 00:00:47
     55172 18-oct-11 00:30:20
     55173 18-oct-11 01:00:50
     55174 18-oct-11 01:30:15
     55175 18-oct-11 02:00:45
........

Since the snapshots are collected every half hour, for the same time period on the previous day we substract 48 – so the snap_ids for the 20th of July are 55125 and 55127.

select * from
(select event, waits "Waits", time "Wait Time (s)", pct*100 "Percent of Total", waitclass "Wait Class"
from (select e.event_name event, e.total_waits - nvl(b.total_waits,0) waits,
(e.time_waited_micro - nvl(b.time_waited_micro,0))/1000000 time
, (e.time_waited_micro - nvl(b.time_waited_micro,0))/(select sum(e1.time_waited_micro - nvl(b1.time_waited_micro,0))
from dba_hist_system_event b1 , dba_hist_system_event e1
where b1.snap_id(+) = b.snap_id and e1.snap_id = e.snap_id and b1.dbid(+) = b.dbid
and e1.dbid = e.dbid and b1.instance_number(+) = b.instance_number
and e1.instance_number = e.instance_number
and b1.event_id(+) = e1.event_id
and e1.total_waits > nvl(b1.total_waits,0)
and e1.wait_class <> 'Idle'
) pct
, e.wait_class waitclass
from
dba_hist_system_event b ,
dba_hist_system_event e
where b.snap_id(+) = &pBgnSnap
and e.snap_id = &pEndSnap
and b.event_id(+) = e.event_id
and e.total_waits > nvl(b.total_waits,0)
and e.wait_class <> 'Idle'
order by waits desc
)
where rownum < 11)
;
Note: we are filtering the rows to display only the Top 10 Wait Events

SnapID’s 55125 and 55127 (17th October)

EVENT                                         Waits Wait Time (s) Percent of Total Wait Class
---------------------------------------- ---------- ------------- ---------------- --------------------
control file sequential read                4803994     79.589894        2.4698686 System I/O
PX qref latch                               1451898      3.587572       .111331112 Other
db file sequential read                       57463    1914.86419       59.4229078 User I/O
SQL*Net message to client                     52040       .077309       .002399087 Network
db file scattered read                         9169    223.497921        6.9356858 User I/O
log file parallel write                        6692    371.933451       11.5420025 System I/O
SQL*Net break/reset to client                  6610       3.75458       .116513778 Application
log file sync                                  3175    211.309884       6.55746127 Commit
direct path read                               2077      1.349465       .041877191 User I/O
control file parallel write                    1857    112.049356        3.4771649 System I/O

10 rows selected.
SnapId’s 55173 and 55175 (18st October)

EVENT                                         Waits Wait Time (s) Percent of Total Wait Class
---------------------------------------- ---------- ------------- ---------------- --------------------
control file sequential read                6006299    101.375645       .512584025 System I/O
SQL*Net message to client                   1045461       1.16951       .005913374 Network
db file sequential read                      312287    7147.10849       36.1378085 User I/O
log file sync                                 86597    8044.46297       40.6750873 Commit
log file parallel write                       62614    3257.61227       16.4714119 System I/O
SQL*Net more data from client                 25708      6.923053        .03500492 Network
SQL*Net break/reset to client                 24824    361.693308       1.82882399 Application
db file scattered read                        18289    178.619015       .903148421 User I/O
SQL*Net more data to client                   14721       .531947       .002689675 Network
db file parallel write                         3128    310.442873       1.56968725 System I/O

10 rows selected.
Looking at this output for the same time period on two days, we find that on the 18st of October the top wait events seem to be all I/O related and if we see the wait event “log file sync” on the second day is significantly higher than the first day. The wait event “db file sequential read” is also significantly higher on the second day as well as compared to the first day.

We can use this information to quickly triage the problem and make the following checks:

Has any thing changed on the storage front especially where the redo log or archive log files are located?

Has there been any new indexes created or modified in some way?

Have any changes been made to the init.ora parameters especially those related to the CBO?

Has the volume of data which is being processed changed significantly between the two days?

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 如果你是班委你不想当了怎么办 孩子读初一爱和同学打架怎么办 陌陌情感连线部分功能被限制怎么办 华为荣耀7x密码忘了怎么办 华为荣耀7x应用锁密码忘了怎么办 同学群里有人发低俗信息怎么办 小孩读英语绘本大人不会翻译怎么办 东西掉到手刹缝里面了怎么办 泰拉瑞亚猩红之地蔓延到家里怎么办 三星r.467玩dnf闪退怎么办 美团外卖不小心撞到汽车怎么办 如果你在战场上遇到华裔美军怎么办 衣服洗完了干了后发黄怎么办 毛衣起球怎么办学会这几个小妙招 小车没电了打不着火怎么办 老婆花钱大手大脚又要我给钱怎么办 住酒店手机id被劫持了怎么办 孩子老是送玩具给别的小朋友怎么办 老板总想和我谈人生怎么办gl 导师让用师姐的数据写论文怎么办 签了平面模特协议想违约怎么办 福州96年以前社保手册丢了怎么办 被老师缴的手机弄没了怎么办 户口在成都医保在德阳生孩子怎么办 微课掌上通看不到孩子班级圈怎么办 微课掌上通的录音错误是怎么办 微课视频录制ppt里面音乐怎么办 老师在街上和别人吵起来了怎么办 手机录屏传到爱剪辑变成竖屏怎么办 尔雅通识课程考试忘记做了怎么办 尔雅通识课过了课程完成时间怎么办 微信账号没冻结登录不了怎么办 微信解封电话号码没有电话号怎么办 ps中智能对象不能直接编辑怎么办 工资低奖金高银行流水不够怎么办 我水费交了自来水公司不给开怎么办 艺考文化分数差4分二本怎么办 学信网手机号换了密码忘记了怎么办 自考毕业证学信网上查不到怎么办 苹果手机自带浏览器证书过期怎么办 手机连接工行证书介质失贩怎么办