根据请求号(request ID)查找正在运行的sql
Posted ORACLE EBS
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了根据请求号(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
以上是关于根据请求号(request ID)查找正在运行的sql的主要内容,如果未能解决你的问题,请参考以下文章