Various Ways to SQL_Trace
Various Ways to SQL_Trace SQL_TRACE enables the logging of all the SQL your application performs, performance statistics regarding the execution of that SQL, and the query plans your SQL actually used. Check the Environment Before tracing using SQL_TRACE, the environment must first be configured by performing the following steps: • Enable Timed Statistics – This parameter enables the collection of certain vital statistics such as CPU execution time, wait events, and elapsed times. The resulting trace output is more meaningful with these statistics. The command to enable timed statistics is: ALTER SESSION SET TIMED_STATISTICS = TRUE; OR ALTER SYSTEM SET TIMED_STATISTICS = TRUE; • Check the User Dump Destination Directory – The trace files generated by Oracle can be numerous and large. These files are placed by Oracle in the user_dump_dest directory as specified in the init.ora. The user dump destination can also be specified for a single session using the alter session command.