根据请求号(request ID)查找正在运行的sql

 

--下面的SQL可以根据Request ID找到对应的Session信息:

select *

from v$session

where paddr in

(select addr

from v$process

where spid =

(select b.oracle_process_id

from apps.fnd_concurrent_requests b

where b.request_id = &req_number))

 

--或者进一步找到正在运行的SQL:

select sql_text

from v$sqltext_with_newlines

where hash_value in

(select SQL_HASH_VALUE

from v$session

where paddr in

(select addr

from v$process

where spid =

(select b.oracle_process_id

from apps.fnd_concurrent_requests b

where b.request_id = &req_number)))

order by piece;

 

--通过request id sql id找到相关脚本

SELECT ses.sid,

        ses.serial# ,

        Ses.sql_id

     FROM v$session ses,

        v$process pro

        WHERE ses.paddr = pro.addr

             AND pro.spid IN (SELECT oracle_process_id

                  FROM fnd_concurrent_requests

                  WHERE request_id = <request_id>);

select sql_text from v$sqltext where sql_id='0kkhhb2w93cx0' order by piece

posted @ 2018-06-03 10:22  全威儒  阅读(1389)  评论(0编辑  收藏  举报