关于I/O的一些脚本

来源:互联网 发布:数学答题软件 编辑:程序博客网 时间:2024/06/05 14:48

可以使用如下脚本查询某个数据文件单块读的平均时间(摘自OWI)

select a.file# "File#",b.file_name "File_Name",a.singleblkrds "Single Block Reads",a.singleblkrdtim "Single Block Read Time",

a.singleblkrds/a.singleblkrdtim average_time from v$filestat a,dba_data_files b where

a.file#=b.file_id and a.singleblkrds>0 and a.singleblkrdtim>0

 average_time以百分之一秒为单位。

如果查询出来的average_time值比较大(大于1,甚至更大),检查数据文件磁盘分布是否和理,检查SQL。

一下脚本可以查看每个数据文件的度量(摘自ORACLE10g性能调整与优化)

select name,phyrds,phywrts,readtim,writetim from
v$filestat a,v$datafile b
where a.file#=b.file# order by readtim desc;

如果phyrds,phywrts在不同的数据文件之间差别很大,表明某个数据文件所存在的磁盘负载过多,可以将其移动到另外一个磁盘上,或者使用分区