TRACEFILE_IDENTIFIER
Enable Tracing:
Alter session set
tracefile_identifier='sadhan_sql_trace';
Alter session set sql_trace=true;
Alter session set events ‘10046 trace name context
forever, level 12’;
Now try to execute your queries and statements and check the
user_dump_dest folder there you will find the file name "SID_ora_nnnn_sadhan_sql_trace.trc”.
Note: This parameter can only be used to
change the name of the foreground process' trace file; the background processes
continue to have their trace files named in the regular format.
Disable Tracing:
Alter session set events ‘10046 trace name context
off’;
Alter session set sql_trace=false;
You can directly find out the trace file name without using
TRACEFILE_IDENTIFIER parameter though the SQL query.
select c.value || '/' || d.instance_name ||'_ora_'
|| a.spid || '.trc' trace
from v$process a, v$session b, v$parameter c,
v$instance d
where a.addr = b.paddr
and b.audsid = userenv('sessionid')
and c.name = 'user_dump_dest';