首页 > 数据库 > Oracle > 从v$diag_info定位trace file
Oracle Support note Interpreting Raw SQL_TRACE output (39817.1). TKPROF
As of version 11.1, it ’ s much easier to query either the v$diag_info or v$process views, as shown in the following examples:
SQL> SELECT value
2 FROM v$diag_info
3 WHERE name = 'Default Trace File';
VALUE
--------------------------------------------------------------------
/u00/app/oracle/diag/rdbms/dba111/DBA111/trace/DBA111_ora_23731.trc
SQL> SELECT p.tracefile
2 FROM v$process p, v$session s
3 WHERE p.addr = s.paddr
4 AND s.sid = sys_context('userenv','sid');
TRACEFILE
--------------------------------------------------------------------
/u00/app/oracle/diag/rdbms/dba111/DBA111/trace/DBA111_ora_23731.trc
Note that the v$diag_info view provides information for the current session only.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/14377/viewspace-2286456/ ,如需转载,请注明出处,否则将追究法律责任。