EBS中可以对某请求启用sql跟踪。



1、定义请求可调试

“应用开发员” --》并发 --》程序:“启用跟踪”

155708653.jpg


2、系统配置文件

如果仅仅是"Enable Trace",收集到的Sql Trace并不包含binds and waits,可通过此处设置。

“系统管理员” --》配置文件 --》系统

Concurrent: Allow Debugging --》 Yes

并发:允许调试 --》是

155728969.jpg


3、提交请求

155748155.jpg

勾选SQL Trace,并选择"SQL Trace with Binds and Waits"


4、查询trace文件

select name, value
from v$parameter
where name like 'user_dump_dest';

在应用主机cd到上边的路径,然后

ls *Concurrent Request ID*


或者通过以下SQL:

SELECT 'Request id: ' || Request_Id,
       'Trace id: ' || Oracle_Process_Id,
       'Trace Flag: ' || Req.Enable_Trace,
       'Trace Name:  ' || Dest.Value || '/' || Lower(Dbnm.Value) || '_ora_' ||
       Oracle_Process_Id || '.trc',
       'Prog. Name: ' || Prog.User_Concurrent_Program_Name,
       'File Name: ' || Execname.Execution_File_Name ||
       Execname.Subroutine_Name,
       'Status : ' || Decode(Phase_Code, 'R', 'Running') || '-' ||
       Decode(Status_Code, 'R', 'Normal'),
       'SID Serial: ' || Ses.Sid || ',' || Ses.Serial#,
       'Module : ' || Ses.Module
  FROM Fnd_Concurrent_Requests    Req,
       V$session                  Ses,
       V$process                  Proc,
       V$parameter                Dest,
       V$parameter                Dbnm,
       Fnd_Concurrent_Programs_Vl Prog,
       Fnd_Executables            Execname
 WHERE 1 = 1
   AND Req.Request_Id = &Request --此处为请求ID
   AND Req.Oracle_Process_Id = Proc.Spid(+)
   AND Proc.Addr = Ses.Paddr(+)
   AND Dest.Name = 'user_dump_dest'
   AND Dbnm.Name = 'db_name'
   AND Req.Concurrent_Program_Id = Prog.Concurrent_Program_Id
   AND Req.Program_Application_Id = Prog.Application_Id
      --- and prog.application_id = execname.application_id 
   AND Prog.Executable_Application_Id = Execname.Application_Id
   AND Prog.Executable_Id = Execname.Executable_Id;