查看Oracle最耗时的SQL的方法
程序员文章站
2022-06-04 10:05:14
1.查看总消耗时间最多的前10条sql语句
select *
from (select v.sql_id,
v.child_number,
v.sql_text,
v.elapsed_t...
1.查看总消耗时间最多的前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.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;
上一篇: OracleJET的结构、组件、常用命令和使用讲解
下一篇: 喝什么对牙好,今天告诉你