欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Oracle查看逻辑读、物理读资源占用排行的SQL语句

程序员文章站 2022-05-18 23:47:28
查看逻辑读前10的sql: 复制代码 代码如下: set linesize 300; set pagesize 300; set long 50000; sele...

查看逻辑读前10的sql:

复制代码 代码如下:

set linesize 300;
set pagesize 300;
set long 50000;
select *
from (
    select sql_fulltext as sql, sql_id,buffer_gets / executions as "gets/exec",buffer_gets, executions
    from v$sqlarea
    where buffer_gets > 10000
    order by "gets/exec" desc
)
where rownum <= 10;

查看物理读前10的sql:

复制代码 代码如下:

set linesize 300;
set pagesize 300;
set long 50000;
select *
from (
    select sql_fulltext as sql, sql_id,disk_reads / executions as "reads/exec",disk_reads, executions
    from v$sqlarea
    where disk_reads > 1000
    order by "reads/exec" desc
)
where rownum <= 10;