Database Reference
In-Depth Information
A query, then, to generate your trace file name could be:
EODA@ORA12CR1> column trace new_val TRACE format a100
EODA@ORA12CR1> select c.value || '/' || d.instance_name || '_ora_' || a.spid || '.trc' trace
2 from v$process a, v$session b, v$parameter c, v$instance d
3 where a.addr = b.paddr
4 and b.audsid = userenv('sessionid')
5 and c.name = 'user_dump_dest'
6 /
TRACE
-------------------------------------------------------------------------------------
/home/ora12cr1/app/ora12cr1/diag/rdbms/ora12cr1/ora12cr1/trace/ora12cr1_ora_22319.trc
And this just shows that if the file exists, you'll be able to access it via that name (assuming you have the
permissions to read the trace directory). The following example generates a trace file, showing how the file is created
once the trace is enabled:
EODA@ORA12CR1> !ls &TRACE
ls: cannot access /home/ora12cr1/app/ora12cr1/diag/rdbms/ora12cr1/ora12cr1/trace/ora12cr1_ora_22319.
trc: No such file or directory
EODA@ORA12CR1> exec dbms_monitor.session_trace_enable
PL/SQL procedure successfully completed.
EODA@ORA12CR1> !ls &TRACE
/home/ora12cr1/app/ora12cr1/diag/rdbms/ora12cr1/ora12cr1/trace/ora12cr1_ora_22319.trc
As you can see, before we enabled tracing in that session, no file existed; as soon as tracing is enabled, however,
we are able to see it.
It should be obvious that on Windows you'd replace the / with \ . If you are using 9i Release 1, instead of adding
the instance name into the trace file name, you'd simply issue the following:
select c.value || 'ora_' || a.spid || '.trc'
Tagging Trace Files
There is a way to “tag” your trace file so that you can find it even if you are not permitted access to V$PROCESS and
V$SESSION . Assuming you have access to read the user_dump_dest directory, you can use the session parameter
tracefile_identifier . With this, you can add a uniquely identifiable string to the trace file name, for example:
EODA@ORA12CR1> alter session set tracefile_identifier = 'Look_For_Me';
Session altered.
EODA@ORA12CR1> !ls /home/ora12cr1/app/ora12cr1/diag/rdbms/ora12cr1/ora12cr1/trace/*Look_For_Me*
ls: cannot access /home/ora12cr1/app/ora12cr1/diag/rdbms/ora12cr1/ora12cr1/trace/*Look_For_Me*: No
such file or directory
EODA@ORA12CR1> exec dbms_monitor.session_trace_enable
PL/SQL procedure successfully completed.
 
Search WWH ::




Custom Search