千家信息网

查看消耗资源最多的SQL

发表于:2025-01-23 作者:千家信息网编辑
千家信息网最后更新 2025年01月23日,SELECT *FROM ( SELECT sqlarea.sql_text,dba_users.username,sqlarea.sql_id,SUM (active_session_history
千家信息网最后更新 2025年01月23日查看消耗资源最多的SQL

SELECT *

FROM ( SELECT sqlarea.sql_text,

dba_users.username,

sqlarea.sql_id,

SUM (active_session_history.wait_time + active_session_history.time_waited)

total_wait_time

FROM v$active_session_history active_session_history, v$sqlarea sqlarea, dba_users

WHERE active_session_history.sample_time BETWEEN SYSDATE - 60 / 2880 AND SYSDATE

AND active_session_history.sql_id = sqlarea.sql_id

AND active_session_history.user_id = dba_users.user_id

GROUP BY active_session_history.user_id,

sqlarea.sql_text,

sqlarea.sql_id,

dba_users.username

ORDER BY 4 DESC) x

WHERE ROWNUM <= 11;


0