1. 查看运行的时间最多的前10调SQL。从大到小排序。注意,当前登录用户需要有DBA权限。
SELECT sql_id, child_number, sql_text, elapsed_time
FROM (SELECT sql_id,
child_number,
sql_text,
elapsed_time,
cpu_time,
disk_reads,
RANK() OVER(ORDER BY elapsed_time DESC) AS elapsed_rank
FROM v$sql)
WHERE elapsed_rank <= 10;