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

查看逻辑读前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;

(0)
上一篇 2022年3月22日
下一篇 2022年3月22日

相关推荐