查询oracle所有执行sqlid中disk读取比重大的sql

通过查询V$sql来查询sql读写disk次数最多的sql排序

SELECT SQL_ID,
       DISK_READS,
       CC.EXECUTIONS,
       DISK_READS / EXECUTIONS,
       cc.ELAPSED_TIME / CC.EXECUTIONS as times,cc.LAST_LOAD_TIME
  fROM V$SQL CC
 WHERE CC.EXECUTIONS > 0
   AND EXECUTIONS > 100
   AND CC.DISK_READS / CC.EXECUTIONS > 1
  

 ORDER BY CC.DISK_READS / CC.EXECUTIONS DESC

 

其中:

 

AND EXECUTIONS > 100 表示最低执行了100次


   AND CC.DISK_READS / CC.EXECUTIONS > 1 表示读写量必须大于1

 

你可能感兴趣的:(Oracle)