Search Results oke_debug




Overview

The OKE_DEBUG package is a PL/SQL server debug log utility that belongs to the Oracle E-Business Suite (EBS) Oracle Knowledge Extensions (OKE) module, which supports the Contracts Core / Project Contracts functionality within the ETRM (Enterprise Trade and Risk Management) family of applications. The package is owned by the APPS schema and is classified under the API classification "OTHER," indicating that it is a utility or infrastructure component rather than a public business API intended for external integration.

The package's primary business function is to provide a centralized mechanism for enabling, disabling, querying, and emitting debug log messages from server-side PL/SQL code. In Oracle EBS 12.1.1 and 12.2.2, developers and support engineers use this utility to trace execution paths and diagnose issues within the OKE application code without modifying the underlying business logic. Because the package is declared with AUTHID CURRENT_USER, it executes with the privileges of the invoking user, ensuring that debug output remains subject to the caller's security context.

Key Procedures and Functions

The package exposes four documented program units, each addressing a distinct aspect of the debug logging lifecycle:

  • Enable_Debug — A procedure that turns on debug logging for the session or runtime context. Once invoked, subsequent debug calls are captured according to the configured log level.
  • Disable_Debug — A procedure that turns off debug logging, restoring normal (non-verbose) execution behavior and preventing unnecessary log writes.
  • Debug_Mode — A function returning a VARCHAR2 value that reports the current debug state. This allows callers to conditionally execute diagnostic code only when debugging is active.
  • Debug — The core logging procedure. It accepts a text message, an optional module identifier, and an optional log level, allowing callers to emit structured diagnostic output tagged by component and severity.

The Debug procedure accepts an IN VARCHAR2 text argument along with an optional module (defaulting to NULL) and an optional numeric log_level (defaulting to NULL). These defaults allow simple one-argument invocations while supporting richer, filtered diagnostics when needed.

Tables Accessed

The ETRM metadata records no tables referenced by this package through APPS synonyms, and no tables are declared in the package specification. The package is therefore a stateless utility library. Any persistence of debug output, if configured, would be handled through an external logging target (such as a database directory, a server-side file, or an operational logging table resolved at runtime), but no such dependency is documented in the supplied metadata.

Usage Notes

OKE_DEBUG is an internal support and development diagnostic tool rather than an end-user-facing API. It is typically invoked in the following ways:

  • Ad hoc SQL sessions: A DBA or developer calls OKE_DEBUG.Enable_Debug in a SQL*Plus or similar session, executes the suspect business process, then reviews the emitted debug output and calls Disable_Debug.
  • Custom or extension code: Oracle development teams embed calls to OKE_DEBUG.Debug inside OKE-triggered PL/SQL routines so that trace messages are emitted only when debug mode is active, as reported by Debug_Mode.
  • Support diagnostics: During Oracle Support engagements, the package is enabled to capture execution traces for contracts-related issues in EBS 12.1.1 and 12.2.2 environments.

Because the package is not referenced by any other documented packages, it functions as a leaf utility with no incoming dependencies. Developers should avoid relying on it for production error handling, as its purpose is diagnostic logging rather than transactional or exception management.