名站网址导航为大家提供关于数据库教程相关的教程网站知识。
这篇文章主要介绍了Oracle查看逻辑读、物理读资源占用排行的SQL数据库语句,需要的朋友可以参考下Oracle中查看慢查询进度的脚本分享
Oracle一个大事务的SQL往往不知道运行到了哪里,可以使用如下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;
关于数据库教程相关的教程网站知识今天我们就说到这里了,希望可以帮到大家。