Tracing a Parallel Query

posted Apr 22, 2012, 12:32 PM by Sachchida Ojha   [ updated Apr 22, 2012, 12:37 PM ]
You can get an event 10046 trace for a parallel query in the same way as you would for any other query.The only difference is that the 10046 event will generate as many trace file as the number of parallel query servers.

SQL> alter session set tracefile_identifier='MyPxTune1';

SQL> alter session set events '10046 trace name context forever, level 12';

SQL> select /*+ parallel (dtc, 16) */ count(1) from dba_tab_columns dtc;

  COUNT(1)
----------
     88069

================================================================================================
if you want to trace  a specific parallel query processes then

SQL> alter system set event 'sql_trace {process: pname = p0002 | p003}';

SQL> alter system set event 'sql_trace {process: pname = p0002 | p003} off';

================================================================================================

SQL> alter session set events '10046 trace name context off';



Comments