Oracle 查找常见耗性能的语句
发布时间:2020-12-12 15:34:15 所属栏目:百科 来源:网络整理
导读:-- 最耗缓存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 10000ORDER BY buffer_gets DESC)WHERE rownum = 10 ;-- 最多物理
-- 最耗缓存 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 ; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |