0
sysstat2
emcs
30次下载
376次浏览
2019-07-24
4.5

脚本内容

-- 特定时间段内数据库SYSSTAT,输入不可留空,也不可重复
select * from (
select 
s.snap_id,stat_name,
value/100 - lag(value) over (partition by stat_name,s.instance_number order by s.snap_id)/100 value,
to_char(begin_interval_time,'MMDD HH24MI"-"') || to_char(end_interval_time,'HH24MI') as SNAP_TIME,
round((to_date(to_char(end_interval_time,'YYYYMMDDHH24MISS'),'YYYYMMDDHH24MISS') - to_date(to_char(begin_interval_time,'YYYYMMDDHH24MISS'),'YYYYMMDDHH24MISS'))*86400) as seconds
from dba_hist_sysstat s ,  dba_hist_snapshot snap
where
snap.snap_id = s.snap_id
and s.instance_number = snap.instance_number
and begin_interval_time > sysdate - nvl('&num_of_dates',3)
--and s.stat_name in ('DB time','CPU used by this session','user I/O wait time','concurrency wait time','application wait time','cluster wait time')
)
pivot
(sum(value) as "SUM" 
for stat_name in (
'&stat1' ,
'&stat2' ,
'&stat3' ,
'&stat4' ,))

评论

贡献排行榜
近期活动
全部
暂无活动,敬请期待...
相关课程
全部