Search Results set_trace_on




Overview

OKC_DEBUG is a diagnostic utility package in the Oracle E-Business Suite Applications (APPS) schema, declared with AUTHID CURRENT_USER and shipped as part of the Oracle Contracts (OKC) product family. Its purpose is not to execute business transactions but to provide a lightweight, reusable instrumentation layer that other OKC packages can call to emit trace messages, control indentation of diagnostic output, and toggle tracing on or off during execution. The package header carries the revision tag $Header: OKCDBUGS.pls 120.0 2005/25/25, confirming its origin as an internal development and support aid rather than an end-user-facing API. In ETRM classification the package is registered as API classification OTHER, reflecting that it exposes no standard business API surface. It is nevertheless widely embedded: the metadata records that OKC_DEBUG is referenced by 91 other packages, indicating that a large portion of the Contracts code base depends on it for conditional logging.

Key Procedures and Functions

The package exposes six documented procedures and a small set of public package globals. The following descriptions reflect documented behavior only.

  • SET_TRACE_ON — The procedure most directly relevant to the user search. It enables tracing for the current session, complementary to SET_TRACE_OFF. Invoking it causes subsequent Log calls to produce diagnostic output.
  • SET_TRACE_OFF — Disables tracing for the session. The package global g_set_trace_off (BOOLEAN, default FALSE) participates in this state, allowing Log calls to short-circuit when tracing is inactive.
  • LOG — The primary message emitter. It accepts a message and, by default, a level of 1 and a module identifier of 'OKC'. Callers use it to record diagnostic text at varying levels of verbosity.
  • SET_INDENTATION — Increases or sets the indentation applied to logged output, typically called on entry to a nested procedure so that trace output reflects call depth.
  • RESET_INDENTATION — Restores indentation to its base state, normally paired with SET_INDENTATION on procedure exit.
  • SET_CONNECTION_CONTEXT — Establishes the session/connection context used by the debugger, relating to the g_session_id global that defaults to OKC_API.G_MISS_CHAR.

The package also declares globals g_session_id, g_profile_log_level (default 0), and g_set_trace_off, which together govern session identity, verbosity threshold, and trace enablement.

Tables Accessed

The only table documented as referenced through APPS synonyms is PLITBLM, the standard Oracle database table used to support DBMS_OUTPUT buffering. Access is therefore indirect and infrastructural: OKC_DEBUG writes diagnostic lines through the output buffer rather than persisting application data. The package does not read or write Contracts business tables, consistent with its role as a pure diagnostic utility.

Usage Notes

OKC_DEBUG is an internal developer and support tool, not a supported public API. It is typically invoked from other OKC PL/SQL packages, which call SET_TRACE_ON at the start of a diagnostic run and LOG throughout processing. DBAs and support engineers may also enable tracing manually from SQL*Plus or another client, provided the output buffer is active, in order to capture execution detail while reproducing a Contracts issue. Indentation procedures are used to make nested call traces readable. Because the package uses AUTHID CURRENT_USER, execution privileges follow the invoking schema. Customizations should not depend on OKC_DEBUG, since it is a noship-flagged internal component and its behavior is not guaranteed across patches or releases.