代码拉取完成,页面将自动刷新
--
-- Show top_x_rows in terms of physical I/O - breakdown by 1 day interval
--
accept start_date prompt 'Start Date (MM/DD) : '
accept end_date prompt 'End Date (MM/DD) : '
accept top_x_rows prompt 'Top x rows (between 3 and 10) : '
@plusenv
@big_job
col sql_id format a13
col module format a30 trunc
col stime format a05 head 'Date
col pct_dreads format 99.9
col pct_iowait format 99.9
col rowrank noprint
break on stime skip 1
select *
from
(
select to_char(sn.begin_interval_time, 'MM/DD') stime
,sqs.module module
,sqs.sql_id sql_id
,sum(DISK_READS_DELTA) dreads
,100*ratio_to_report(sum(DISK_READS_DELTA)) over () pct_dreads
,sum(IOWAIT_DELTA) iowait
,100*ratio_to_report(sum(IOWAIT_DELTA)) over () pct_iowait
,row_number() over (partition by to_char(sn.begin_interval_time, 'MM/DD') order by sum(DISK_READS_DELTA) desc) rowrank
from dba_hist_sqlstat sqs
,dba_hist_snapshot sn
where sqs.snap_id = sn.snap_id
and sqs.dbid = sn.dbid
and sqs.instance_number = sn.instance_number
and to_char(sn.begin_interval_time,'MM/DD') between '&&start_date'
and '&&end_date'
group by to_char(sn.begin_interval_time, 'MM/DD')
,sqs.module
,sqs.sql_id
)
where rowrank <= &&top_x_rows
order by stime
,rowrank
;
@big_job_off
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。