Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3672308
  • 博文数量: 715
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7745
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(715)

文章存档

2023年(75)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

分类: Oracle

2010-04-27 22:27:05

Oracle Support Note  ID 422414.1
 
select begin_time,end_time,
trunc(Physical_Read_Total_Bps)Physical_Read_Total_Bps,
trunc(Physical_Write_Total_Bps,1) Physical_Write_Total_Bps ,
trunc(Redo_Bytes_per_sec ,1) Redo_Bytes_per_sec,
trunc(Physical_Read_IOPS ,1) Physical_Read_IOPS,
trunc(Physical_write_IOPS ,1)Physical_write_IOPS ,
trunc( Physical_redo_IOPS,1)Physical_redo_IOPS ,
trunc(OS_LOad ,1) OS_LOad,
trunc(DB_CPU_Usage_per_sec ,1)DB_CPU_Usage_per_sec ,
trunc( Host_CPU_util,1) Host_CPU_util,
trunc( Network_bytes_per_sec,1)Network_bytes_per_sec ,
snap_id
from(
select min(begin_time) begin_time, max(end_time) end_time,
       sum(case metric_name when 'Physical Read Total Bytes Per Sec' then average end) Physical_Read_Total_Bps,
       sum(case metric_name when 'Physical Write Total Bytes Per Sec' then average end) Physical_Write_Total_Bps,
       sum(case metric_name when 'Redo Generated Per Sec' then average end) Redo_Bytes_per_sec,
       sum(case metric_name when 'Physical Read Total IO Requests Per Sec' then average end) Physical_Read_IOPS,
       sum(case metric_name when 'Physical Write Total IO Requests Per Sec' then average end) Physical_write_IOPS,
       sum(case metric_name when 'Redo Writes Per Sec' then average end) Physical_redo_IOPS,
       sum(case metric_name when 'Current OS Load' then average end) OS_LOad,
       sum(case metric_name when 'CPU Usage Per Sec' then average end) DB_CPU_Usage_per_sec,
       sum(case metric_name when 'Host CPU Utilization (%)' then average end) Host_CPU_util, --NOTE 100% = 1 loaded RAC node
       sum(case metric_name when 'Network Traffic Volume Per Sec' then average end) Network_bytes_per_sec,
       snap_id
from dba_hist_sysmetric_summary
group by snap_id
order by snap_id);
 
汇总的
select begin_time ,end_time, trunc(Phys_IO_Tot_MBps ,1) Phys_IO_Tot_MBps,
 trunc( Phys_IOPS_Tot,1)Phys_IOPS_Tot ,
  trunc(OS_LOad ,1)OS_LOad ,
 trunc( DB_CPU_Usage_per_sec,1)DB_CPU_Usage_per_sec ,
  trunc( Host_CPU_util,1) Host_CPU_util,
 trunc(Network_bytes_per_sec ,1)Network_bytes_per_sec ,snap_id
from (
select min(begin_time)begin_time, max(end_time)end_time,
sum(case metric_name when 'Physical Read Total Bytes Per Sec' then maxval end)/1024/1024 +
sum(case metric_name when 'Physical Write Total Bytes Per Sec' then maxval end)/1024/1024 +
sum(case metric_name when 'Redo Generated Per Sec' then maxval end)/1024/1024 Phys_IO_Tot_MBps,
sum(case metric_name when 'Physical Read Total IO Requests Per Sec' then maxval end) +
sum(case metric_name when 'Physical Write Total IO Requests Per Sec' then maxval end) +
sum(case metric_name when 'Redo Writes Per Sec' then maxval end) Phys_IOPS_Tot,
sum(case metric_name when 'Current OS Load' then maxval end) OS_LOad,
sum(case metric_name when 'CPU Usage Per Sec' then maxval end) DB_CPU_Usage_per_sec,
sum(case metric_name when 'Host CPU Utilization (%)' then maxval end) Host_CPU_util, --NOTE 100% = 1 loaded RAC node
sum(case metric_name when 'Network Traffic Volume Per Sec' then maxval end) Network_bytes_per_sec,
snap_id
from dba_hist_sysmetric_summary
group by snap_id
order by snap_id);
 
阅读(3048) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~