Monday, September 30, 2013

Get 10046 trace for session

A) Right from the start when gathering stats for table TAB:
alter session set tracefile_identifier='10046';
alter session set timed_statistics = true;
alter session set statistics_level=all;
alter session set max_dump_file_size = unlimited;
alter session set events '10046 trace name context forever,level 12';
execute DBMS_STATS.GATHER_table_STATS (ownname =>'SSS' ,tabname => 'SCANS' , estimate_percent =>20 );



oradebug setorapid 23806 <PID>
oradebug unlimit
oradebug event 10046 trace name context forever,level 12

genprd_ora_23806_10046.trc
B) When the stats collection is already started:
Use the following note, section 'Tracing a process after it has started'
Note 376442.1 Recommended Method for Obtaining 10046 trace for Tuning
Let this run for a period as long as possible and upload the trace file

No comments:

Post a Comment