046 Oracle执行慢的SQL

前端之家收集整理的这篇文章主要介绍了046 Oracle执行慢的SQL前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
 1 -- 执行最慢的sql
 2 SELECT *
 3 FROM (SELECT sa.sql_TEXT, 4             sa.sql_FULLTEXT, 5             sa.EXECUTIONS as "exeCount", 6             ROUND(sa.ELAPSED_TIME / 1000000,2) as "execTimeTotal", 7             ROUND(sa.ELAPSED_TIME / 1000000 / sa.EXECUTIONS,2) as "execTimeAvg", 8             sa.COMMAND_TYPE, 9             sa.PARSING_USER_ID,10             u.username,11             sa.HASH_VALUE
12         FROM v$sqlarea sa
13         LEFT JOIN all_users u
14         ON  sa.PARSING_USER_ID = u.user_id
15         WHERE sa.EXECUTIONS > 0
16         ORDER BY (sa.ELAPSED_TIME / sa.EXECUTIONS) DESC)
17 WHERE rownum <= 50;

猜你在找的Oracle相关文章