本文主要是介绍Oracle 数据库找到单次消耗资源多的语句(DB),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
代价最高的SQL
select OPTIMIZER_COST,EXECUTIONS,sql_text from v$sqlarea
where OPTIMIZER_COST>
(select max(OPTIMIZER_COST)/5 from v$sqlarea);
IO最高的SQL
select round(DISK_READS/EXECUTIONS) ,DISK_READS,EXECUTIONS,sql_text
from v$sqlarea
where round(DISK_READS/EXECUTIONS)>
(select max(round((DISK_READS/EXECUTIONS)/5)) from v$sqlarea
where EXECUTIONS>0)
and EXECUTIONS>0 and DISK_READS>100
order by 1;
处理行最高的SQL
select round(ROWS_PROCESSED/EXECUTIONS) ,ROWS_PROCESSED,EXECUTIONS,sql_text
from v$sqlarea
where round(ROWS_PROCESSED/EXECUTIONS)>
(select max(round((ROWS_PROCESSED/EXECUTIONS)/5)) from v$sqlarea
where EXECUTIONS>0)
and EXECUTIONS>0 and ROWS_PROCESSED>1000
order by 1;
这篇关于Oracle 数据库找到单次消耗资源多的语句(DB)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!