How to find the trace file name?

— One can use the following query to find the name of the trace filename

— To find the name of the current session
select instance_name || ‘_ora_’ || spid || ‘.trc’ filename
from v$process p, v$session s, v$instance
where p.addr = s.paddr
and s.sid = (select sid from v$mystat where rownum = 1);

FILENAME
——————————
orcl_ora_1360.trc

— To find the filename for another known SID
select instance_name || ‘_ora_’ || spid || ‘.trc’ filename
from v$process p, v$session s, v$instance
where p.addr = s.paddr
and s.sid = 170;

FILENAME
——————————
orcl_ora_2552.trc

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.