- 最后登录
- 2014-5-13
- 在线时间
- 29 小时
- 威望
- 55
- 金钱
- 255
- 注册时间
- 2011-10-12
- 阅读权限
- 50
- 帖子
- 20
- 精华
- 1
- 积分
- 55
- UID
- 11
|
2#
发表于 2013-3-26 16:40:46
- select instance_number,
- snap_id,
- min(begin_time) as 快照开始时间,
- max(end_time) as 快照停止时间,
- round(sum(case metric_name
- when 'Host CPU Utilization (%)' then
- average
- end)) as CPU使用率,
- sum(case metric_name
- when 'Current OS Load' then
- MAXVAL
- end) as 最大OS负载,
- sum(case metric_name
- when 'Current OS Load' then
- average
- end) as 平均OS负载,
- round(sum(case metric_name
- when 'User Transaction Per Sec' then
- average
- end)) as 每秒事务数,
- round(sum(case metric_name
- when 'Executions Per Sec' then
- average
- end)) as 每秒SQL执行次数,
- round(sum(case metric_name
- when 'Logical Reads Per Sec' then
- average
- end)) as 每秒逻辑读总量,
- round(sum(case metric_name
- when 'Physical Read Total IO Requests Per Sec' then
- average
- end)) as 物理读IOPS,
- round(sum(case metric_name
- when 'Physical Write Total IO Requests Per Sec' then
- average
- end)) as 物理写IOPS,
- round(sum(case metric_name
- when 'Redo Writes Per Sec' then
- average
- end)) as REDO_IOPS,
- round(sum(case metric_name
- when 'Physical Read Total Bytes Per Sec' then
- average / 1024 / 1024
- end)) as 物理读MBPS,
- round(sum(case metric_name
- when 'Physical Write Total Bytes Per Sec' then
- average / 1024 / 1024
- end)) as 物理写MBPS,
- round(sum(case metric_name
- when 'Redo Generated Per Sec' then
- average / 1024 / 1024
- end)) as REDO_MBPS,
- round(sum(case metric_name
- when 'Network Traffic Volume Per Sec' then
- average / 1024 / 1024
- end)) as 每秒网络流量_MB
- from dba_hist_sysmetric_summary t
- where t.instance_number in (1 /*, 2*/)
- and begin_time >= trunc(sysdate)
- group by instance_number, snap_id
- order by snap_id desc, instance_number;
复制代码 供参考! |
|