Chinaunix首页 | 论坛 | 博客
  • 博客访问: 142762
  • 博文数量: 11
  • 博客积分: 1400
  • 博客等级: 上尉
  • 技术积分: 875
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-16 18:55
文章分类

全部博文(11)

文章存档

2008年(11)

我的朋友

分类: Oracle

2008-03-22 10:39:17

A note on tracing concurrent programs. This is usefull for investigating
performance problems or retrieving the SQL statements executed by the program.

1. Get details on the program:
 
   sqlplus system/password

   select sid, serial#, program
   from   v$session
   where  username like '%APPS%'
   and program like '%FADEPR%'
   /

   NOTE : SID and SERIAL#
   where username is apps schema / user name
   There may be multiple running programs, ensure the correct program is
   traced.

2. Enable tracing:

   sqlplus sys/password
  
   execute dbms_system.set_sql_trace_in_session(SID,SERIAL#,true);

3. Disable tracing:

    sqlplus sys/password

    execute dbms_system.set_sql_trace_in_session(SID,SERIAL#,false);

OR  let program finish.

4. Get a formatted view of the trace:

    tkprof tracefile outfile.prv explain=apps/apps

    or

    tkprof tracefile outfile.prv sys=no

    Trace file will be written to USER_DUMP_DEST
 


This method is ideal when a program is in a running state and needs to be
traced.


阅读(1200) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~