How to generate Session Trace from Toad or SQL Plus

alter session set max_dump_file_size = 50000000;

alter session set sql_trace = true;

========
Run your SQL’s
========
alter session set sql_trace = false;

— Run the following query to find the trc file

select vpar.value || ‘/’ || instance || ‘_ora_’ || ltrim(to_char(vp.spid,’fm99999′)) || ‘.trc’
from v$process vp, v$session vs, v$parameter vpar, v$thread vthr
where vp.addr = vs.paddr
and vs.audsid = userenv(‘sessionid’)
and vpar.name = ‘user_dump_dest’
Once you have the trc file use the standard tkprof procedure to get the tkp / tkprof file

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s