Oracle檢視TOP SQL

壹頁書發表於2014-06-16
檢視邏輯讀前10的SQL
  1. set linesize 300;
  2. set pagesize 300;
  3. set long 50000;
  4. SELECT *
  5. FROM (
  6.     SELECT sql_fulltext AS sql, SQL_ID,buffer_gets / executions AS "Gets/Exec",buffer_gets, executions
  7.     FROM V$SQLAREA
  8.     WHERE buffer_gets > 10000
  9.     ORDER BY "Gets/Exec" DESC
  10. )
  11. WHERE rownum <= 10;

檢視物理讀前10的SQL
  1. set linesize 300;
  2. set pagesize 300;
  3. set long 50000;
  4. SELECT *
  5. FROM (
  6.     SELECT sql_fulltext AS sql, SQL_ID,disk_reads / executions AS "Reads/Exec",disk_reads, executions
  7.     FROM V$SQLAREA
  8.     WHERE disk_reads > 1000
  9.     ORDER BY "Reads/Exec" DESC
  10. )
  11. WHERE rownum <= 10;

拿到SQL_ID,可以使用調整顧問,大致看一下最佳化
http://blog.itpub.net/29254281/viewspace-1080490/

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29254281/viewspace-1183832/,如需轉載,請註明出處,否則將追究法律責任。

相關文章