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) |