-- 最耗缓存
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, executions, disk_reads/executions "Reads/Exec",
hash_value,address,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,
executions, rows_processed, rows_processed/executions "Rows/Exec",
hash_value,address,LAST_ACTIVE_TIME
FROM V$SQLAREA
WHERE executions > 100
ORDER BY executions DESC)
WHERE rownum <= 10 ;
-- 最耗内存
SELECT * FROM (
SELECT substr(sql_text,1,40) sql,
sharable_mem, executions, hash_value,address,LAST_ACTIVE_TIME
FROM V$SQLAREA
WHERE sharable_mem > 1048576
ORDER BY sharable_mem DESC)
WHERE rownum <= 10 ;