Search Results is_trace_enabled




Overview

FND_TRACE is a server-side PL/SQL package, owned by APPS, that provides a programmatic interface to Oracle's SQL trace and PL/SQL profiling facilities from within Oracle E-Business Suite. Its principal business function is to allow developers, DBAs, and support analysts to instrument a session with performance diagnostics without leaving the EBS runtime environment. Rather than requiring direct invocation of DBMS_SYSTEM or manual ALTER SESSION statements, FND_TRACE exposes a controlled API that starts and stops trace collection, tags trace output with an operator-supplied identifier, retrieves the resulting trace file name and location, and submits profiler reports for analysis. This is particularly valuable during performance troubleshooting, concurrent program tuning, and diagnostics of long-running EBS processes, where correlating a specific database trace file to a specific user action or concurrent request is otherwise difficult. The package carries header revision 120.1 (2005) and remains the standard EBS tracing entry point in both the 12.1.1 and 12.2.2 code lines.

Key Procedures and Functions

  • START_TRACE — Overloaded procedure that enables tracing for the current session or, in the second form, for a specified SESSION_ID and SERIAL# combination. A TRACE_TYPE argument selects the level of detail collected.
  • STOP_TRACE — Overloaded procedure mirroring START_TRACE, disabling tracing for the current session or for an explicitly identified session. Defaults to the SQL_BINDS_WAITS trace type.
  • SET_TRACE_IDENTIFIER — Procedure that accepts an IDENTIFIER_STRING and embeds it in the trace file. This is the object most commonly searched for by developers, and it is the primary mechanism for tagging a trace so that the correct file can be located later.
  • SET_MAX_DUMP_FILE_SIZE — Procedure that sets the maximum size of the generated trace/dump file, preventing uncontrolled growth of trace output.
  • GET_TRACE_IDENTIFIER — Function returning the identifier string previously set for the current trace.
  • GET_TRACE_FILENAME — Function returning the physical file name of the trace file being written, enabling the caller to locate the output on the database server.
  • GET_TRACE_LEVEL — Function returning the numeric trace level corresponding to a given TRACE_TYPE.
  • GET_TRACE_ID — Function returning trace identifiers, including related_runid, spid, and prof_runid, used to correlate trace output with the underlying OS processes.
  • IS_TRACE_ENABLED — Boolean function indicating whether tracing is currently active for a given TRACE_TYPE.
  • SUBMIT_PROFILER_REPORT — Function that submits a PL/SQL profiler report for a given PROF_RUNID and RELATED_RUNID, optionally purging source data. An overloaded form takes no arguments.

The package also declares trace-type constants (SQL_REGULAR, SQL_BINDS, SQL_WAITS, SQL_BINDS_WAITS, PLSQL_INSTR, PLSQL_PROF, CBO) and a RELATED_RUNID global.

Tables Accessed

FND_TRACE references only dynamic performance views and utility objects through APPS synonyms: V$SESSION, V$PROCESS, V$INSTANCE, DUAL, and DBMS_SYSTEM. V$SESSION supplies session identity (SID, SERIAL#) for targeted tracing; V$PROCESS provides the server process ID used in the trace file name and identifier correlation; V$INSTANCE supports instance-level context; DUAL is used for simple scalar evaluations; and DBMS_SYSTEM provides the underlying SID/serial-based trace control calls. No EBS application tables are written by this package.

Usage Notes

FND_TRACE is invoked from custom PL/SQL, concurrent program wrappers, and diagnostic scripts during performance investigations. Typical usage is to call START_TRACE, then SET_TRACE_IDENTIFIER with a meaningful tag such as a concurrent request ID or user name, execute the code under investigation, and finally call STOP_TRACE. GET_TRACE_FILENAME then locates the output on the database server for review with TKPROF or the PL/SQL profiler. Two other packages reference FND_TRACE, confirming its role as a shared utility. Because trace file generation consumes disk and I/O, it is normally enabled only for short, targeted diagnostic windows and disabled immediately afterward.