Tracing the execution of a SQL
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;
/* now you execute the sql that you want to trace */
exit;
exit;
The trace file will be located in your diagnostic destination and will have the number 10046 as part of the file_name, you want to go there to format it using tkprof.
tkprof input_file output_file waits=yes explain=username/password
Note: you can use the sort clause to sort the output in many ways, for a complete description of options please check the following resources:
Cheers!!!!