ICode9

精准搜索请尝试: 精确搜索
首页 > 数据库> 文章详细

查看Oracle耗时Sql

2020-01-22 17:42:24  阅读:25  来源: 互联网

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



--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;

星星点点的绿光 发布了20 篇原创文章 · 获赞 3 · 访问量 2220 私信 关注

标签:Sql,rank,elapsed,耗时,reads,time,sql,Oracle,select
来源: https://blog.csdn.net/xiyang87/article/details/104071303

专注分享技术,共同学习,共同进步。侵权联系[admin#icode9.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有