签到成功

知道了

CNDBA社区CNDBA社区

Oracle查询SQL语句执行的耗时

2021-10-19 17:23 2313 0 原创 oracle
作者: hbhe0316
select a.sql_text SQL语句,
       b.etime 执行耗时,
       c.user_id 用户ID,
       c.SAMPLE_TIME 执行时间,
       c.INSTANCE_NUMBER 实例数,
       u.username 用户名, a.sql_id SQL编号
  from dba_hist_sqltext a,
       (select sql_id, ELAPSED_TIME_DELTA / 1000000 as etime
          from dba_hist_sqlstat
         where ELAPSED_TIME_DELTA / 1000000 >= 1) b,
       dba_hist_active_sess_history c,
       dba_users u
 where a.sql_id = b.sql_id
   and u.username = 'SYNC_PLUS_1_20190109'
   and c.user_id = u.user_id
   and b.sql_id = c.sql_id
  -- and a.sql_text like '%insert into GK_ZWVCH_HSC_NEW      select  %'
 order by  SAMPLE_TIME desc,
  b.etime desc;
http://www.cndba.cn/hbhe0316/article/4952 http://www.cndba.cn/hbhe0316/article/4952
http://www.cndba.cn/hbhe0316/article/4952
http://www.cndba.cn/hbhe0316/article/4952
http://www.cndba.cn/hbhe0316/article/4952 http://www.cndba.cn/hbhe0316/article/4952 http://www.cndba.cn/hbhe0316/article/4952 http://www.cndba.cn/hbhe0316/article/4952 http://www.cndba.cn/hbhe0316/article/4952 http://www.cndba.cn/hbhe0316/article/4952

版权声明:本文为博主原创文章,未经博主允许不得转载。

oracle,linux

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
hbhe0316

hbhe0316

关注

1.只有承认无知,才能装下新的东西; 2.进步来自一点点滴滴的积累; 3.广博让你更优秀,而专业让你无法替代; 4.挫折和失败能够转换为一种财富。

  • 889
    原创
  • 1
    翻译
  • 13
    转载
  • 24
    评论
  • 访问:1154520次
  • 积分:1523
  • 等级:核心会员
  • 排名:第6名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ