Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Find trace file in Oracle tips

Oracle Database Tips by Donald BurlesonNovember 10, 2015

Question:  How do I find the location of an Oracle trace file?

Answer:  You find trace files in the $ADR_HOME directory is located by default at $ORACLE_BASE/diag, with the trace file directories for each instance at $ORACLE_HOME/diag/$ORACLE_SID, at the same level as the traditional bdump, udump and cdump directories.

The initialization parameters background_dump_dest and user_dump_dest are deprecated in 11g.   Using the x$dbgdirext fixed table, you can find the directory with trace files.  This query is used to find Oracle trace files:

select
   lpad(' ', lvl, ' ')||logical_file trace_name

from
   x$dbgdirext

where
   logical_file like '%.trc';


TRACE_NAME
---------------------------------------------------------------------------
ora_3480_5840.trc
iondb_cjq0_7500.trc
iondb_dbrm_10476.trc
iondb_dbrm_5736.trc
iondb_dbrm_8860.trc

It's worth noting that logical_path on Windows gives forward slashes, physical_path on windows gives backslashes.

select
   logical_path||'/'||logical_file trace_file

from
   x$dbgdirext
where
   logical_file like '%.trc';

TRACE_FILE
--------------------------------------------------------------------------------
c:/oracle/diag/clients/user_unknown/host_411310321_11/trace/ora_3480_5840.trc
c:/oracle/diag/rdbms/iondb/iondb/trace/iondb_cjq0_7500.trc
c:/oracle/diag/rdbms/iondb/iondb/trace/iondb_dbrm_10476.trc
c:/oracle/diag/rdbms/iondb/iondb/trace/iondb_dbrm_5736.trc
c:/oracle/diag/rdbms/iondb/iondb/trace/iondb_dbrm_8860.trc
c:/oracle/diag/rdbms/iondb/iondb/trace/iondb_m000_10080.trc
c:/oracle/diag/rdbms/iondb/iondb/trace/iondb_m000_10100.trc

You can also find trace file information from the v$diag_info view:

select
   name,
   value
from
   v$diag_info;


NAME VALUE
--------------------- ---------------------------------------------------
Default Trace File    /u01/app/oracle/diag/rdbms/db11/db1/trc/ora_9230.trc

You can find the location of your Oracle trace file with this dictionary query.  It joins v$process into v$parameter to display the directory location to find where the trace files reside:

select
   u_dump.value || '/' ||
   db_name.value || '_ora_' ||
   v$process.spid ||
   nvl2(v$process.traceid, '_' || v$process.traceid, null )||'.trc' "Trace File"
from
   v$parameter u_dump
cross join
   v$parameter db_name

cross join
   v$process

join
   v$session

on
   v$process.addr = v$session.paddr

where
   u_dump.name = 'user_dump_dest'
and

   db_name.name = 'db_name'
and

v$session.audsid=sys_context('userenv','sessionid');

Oracle now has the x$dbgdirext fixed table to scan directories for locating trace and dump files. The name implies what this table does, it allows you to cascade down the $ORACLE_HOME/diag directly structure just as if you were using a standard UNIX/Linux command:

root> cd $ORACLE_HOME/diag

root> find . -print|grep trc

You can also query x$dbgdirext to see all contents of the $ORACLE_HOME/diag directory in a hierarchical form:

SQL> select lpad(' ', lvl, ' ') || logical_file trace_name from x$dbgdirext;

TRACE_NAME
-----------------------------------------------------------------------------
asm
clients
user_steve
host_2921648914_11
alert
log.xml
cdump
incident
incpkg
lck
am_1096102193_3488045378.lck

 

   
Oracle Training from Don Burleson 

The best on site "Oracle training classes" are just a phone call away! You can get personalized Oracle training by Donald Burleson, right at your shop!

Oracle training
 
 


 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational

 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster