--1、查看耗时SQL

select *

from (select v.sql\_id,

v.child\_number,


v.sql\_text,

v.elapsed\_time,

v.cpu\_time,

v.disk\_reads,

rank() over(order by v.elapsed\_time desc) elapsed\_rank

from v$sql v) a

where elapsed\_rank <= 10;

-- 2.查看CPU消耗时间最多的前10条SQL语句

select *

from (select v.sql\_id,

v.child\_number,

v.sql\_text,

v.elapsed\_time,

v.cpu\_time,

v.disk\_reads,

rank() over(order by v.cpu\_time desc) elapsed\_rank

from v$sql v) a

where elapsed\_rank <= 10;

--3.查看消耗磁盘读取最多的前10条SQL语句

select *

from (select v.sql\_id,

v.child\_number,

v.sql\_text,

v.elapsed\_time,

v.cpu\_time,

v.disk\_reads,

rank() over(order by v.disk\_reads desc) elapsed\_rank

from v$sql v) a

where elapsed\_rank <= 10;

查看Oracle耗时Sql教程星星点点的绿光发布了20 篇原创文章 · 获赞 3 · 访问量 2220 私信 关注

标签: select, Oracle, sql, time, rank, 耗时, elapsed, Sql, reads

相关文章推荐

添加新评论,含*的栏目为必填