Oracle 查找常见耗性能的语句

前端之家收集整理的这篇文章主要介绍了Oracle 查找常见耗性能的语句前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
-- 最耗缓存
SELECT * FROM (
SELECT sql_FULLTEXT sql,buffer_gets,executions,buffer_gets/executions "Gets/Exec",hash_value,address,LAST_ACTIVE_TIME
   FROM V$sqlAREA
  WHERE buffer_gets > 10000
ORDER BY buffer_gets DESC)
WHERE rownum <= 10 ;

-- 最多物理读取
SELECT * FROM (
SELECT sql_FULLTEXT sql,disk_reads,disk_reads/executions "Reads/Exec",LAST_ACTIVE_TIME
   FROM V$sqlAREA
  WHERE disk_reads > 1000
ORDER BY disk_reads DESC)
WHERE rownum <= 10 ;


-- 最多执行
SELECT * FROM (
SELECT substr(sql_text,1,40) sql,sql_FULLTEXT,rows_processed,rows_processed/executions "Rows/Exec",LAST_ACTIVE_TIME
   FROM V$sqlAREA
  WHERE executions > 100
ORDER BY executions DESC)
WHERE rownum <= 10 ;

-- 最耗内存
SELECT * FROM (
SELECT substr(sql_text,sharable_mem,LAST_ACTIVE_TIME
   FROM V$sqlAREA
  WHERE sharable_mem > 1048576
ORDER BY sharable_mem DESC)
WHERE rownum <= 10 ;

猜你在找的Oracle相关文章