正德厚生,臻于至善

查询请求正在执行的SQL

SELECT vp.spid, --top进程pid ,用root 去 kill -9 spid
       vs.sid, --数据库session_id
       vs.SQL_ID,
       (select gt.SQL_TEXT
          from gv$sqlarea gt
         where gt.SQL_ID = vs.SQL_ID
           and gt.INST_ID = vs.INST_ID) aaa,
       vs.serial#,
       vs.machine,
       --vs.process 应用process,
       --vs.program,
       vs.inst_id,
       fcpv.user_concurrent_program_name,
       fcr.request_id, --请求id
       fcr.phase_code,
       fcr.status_code,
       vs.username,
       fcr.oracle_session_id,
       command,
       fcr.ACTUAL_START_DATE,
       fcr.ACTUAL_START_DATE,
       fcr.ACTUAL_COMPLETION_DATE,
       vs.SERVICE_NAME
  FROM gv$session                 vs,
       gv$process                 vp,
       fnd_concurrent_requests    fcr,
       fnd_concurrent_programs_vl fcpv
 WHERE vp.addr(+) = vs.paddr
   AND fcr.oracle_session_id(+) = vs.audsid
   AND vs.inst_id = vp.inst_id(+)
      --  AND vp.spid in(1638)
      --AND vs.sid IN (2401)--1006187,1006200
      -- AND fcr.phase_code = 'C'-- 
      --and fcr.concurrent_program_id = 89374
   --AND fcr.PARENT_REQUEST_ID = 172913249 --957173  -- =  (6375476 )--(970084)4376603  4348338
   and fcr.REQUEST_ID = 22222
      --CUX:薪酬凭证导入 CUX:收入导入总帐  CUX:薪酬凭证导入
      --  and fcpv.USER_CONCURRENT_PROGRAM_NAME = 'CUX_GL报账系统总账凭证导入'-- 'CUX:营业日报导入应收模块(邮务)'
      --and fcr.phase_code = 'R'
      --and fcr.status_code ='R'
   AND fcpv.concurrent_program_id(+) = fcr.concurrent_program_id;
set lines 200 pages 50000
col USERNAME for a10
SELECT USERNAME,
       SID,
       OPNAME,
       ROUND(SOFAR * 100 / TOTALWORK, 0) || '%' AS PROGRESS,
       TIME_REMAINING,
       SQL_TEXT
  FROM GV$SESSION_LONGOPS, GV$SQL
 WHERE TIME_REMAINING <> 0
   AND SQL_ADDRESS = ADDRESS
   AND SQL_HASH_VALUE = HASH_VALUE;
赞(0) 打赏
未经允许不得转载:徐万新之路 » 查询请求正在执行的SQL

评论 抢沙发

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫

微信扫一扫

登录

找回密码

注册