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;
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。