Oracle EBS - Setup: 如何对并发请求做Trace

profile : Concurrent: Allow Debugging

set to  : Yes

1. 设置profile,允许并发程序调试

2. 设置并发程序,勾上Enable Trace

 

3. 提交请求时,设置Debug Option,在弹出来的调试选项页面里勾选选择SQL Trace,然后提交请求

 

4.获取Trace文件

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 req.request_id = &request
   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;


5.使用tkprof命令转换trc文件为txt文件

tkprof test_ora_14218.trc test_ora_14218.txt

$tkprof raw_trace_file.trc output_file explain=apps/apps sort=(exeela,fchela) sys=no

Where:

raw_trace_file.trc: Name of trace file
output_file: tkprof out file
explain: This option provides the explain plan for the sql 
statements
sort: This provides the sort criteria in which all sql 
statements will be sorted. This will bring the bad sql at 
the top of the outputfile.
sys=no: Disables sql statements issued by user SYS


 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值