How can I generate trace file from within SQL developer in Oracle? I know how to generate explain plan
but I want to know how to generate a trace (.trc
) file.
There’s several ways you can do it, one is
alter session set events '10046 trace name context forever, level 12';
End it with
alter session set events '10046 trace name context off';
Then grab the file - you can look up the path by checking the session’s process in v$process
. If you’re on a modern version of Oracle you can read it directly from v$diag_trace_file_contents
, Jonathan Lewis has a really useful view that you can set up as SYS to make this simple and safe https://jonathanlewis.wordpress.com/2019/10/03/trace-files-2/