魔镜魔镜告诉我,最耗时的sql是哪个?-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 3502621
  • 博文数量: 718
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7790
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(718)

文章存档

2024年(4)

2023年(74)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

最近访客
相关博文
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·

分类: oracle

2020-12-22 22:06:51


给你一个库,来,很快啊,告诉客户,哪个sql最慢?

点击(此处)折叠或打开

  1. select *
  2.   from (select status,
  3.                --username,
  4.                sql_id,
  5.                sql_exec_id,
  6.                to_char(sql_exec_start, 'yyyy-mm-dd hh24:mi:ss') as sql_exec_start,
  7.                round(elapsed_time / 1000000) as "elapsed (s)",
  8.                round(cpu_time / 1000000) as "cpu (s)",
  9.                buffer_gets,
  10.                round(physical_read_bytes / (1024 * 1024)) as "phys reads (mb)",
  11.                round(physical_write_bytes / (1024 * 1024)) as "phys writes (mb)"
  12.           from v$sql_monitor
  13.          order by elapsed_time desc)
  14.  where rownum <= 20;



接着挖黑历史:

点击(此处)折叠或打开

  1. select round(elapsed_time /1000000) as "elapsed (s)",
  2.      round(cpu_time /1000000,3) as "cpu (s)",
  3.      round(queuing_time /1000000,3) as "queuing (s)",
  4.      round(application_wait_time/1000000,3) as "appli wait (s)",
  5.      round(concurrency_wait_time/1000000,3) as "concurrency wait (s)",
  6.      round(cluster_wait_time /1000000,3) as "cluster wait (s)",
  7.      round(user_io_wait_time /1000000,3) as "user io wait (s)",
  8.      round(physical_read_bytes /(1024*1024)) as "phys reads (mb)",
  9.      round(physical_write_bytes /(1024*1024)) as "phys writes (mb)",
  10.      buffer_gets as "buffer gets",
  11.      round(plsql_exec_time/1000000,3) as "plsql exec (s)",
  12.      round(java_exec_time /1000000,3) as "java exec (s)"
  13.      from v$sql_monitor
  14.      where sql_id = '&sql_id'
  15.      and sql_exec_id = &exec_id
  16.      and sql_exec_start=to_date('&exec_date','yyyy-mm-dd hh24:mi:ss');



引自:https://blog.yannickjaquier.com/oracle/real-time-sql-monitoring.html
阅读(1801) | 评论(0) | 转发(0) |
0

上一篇:隐藏 temp 1.23

下一篇:nbu客户端安装点滴

给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图