Search Results set_ctx




Overview

SYS.OWA_VPD_CTX is a low-level Oracle-supplied PL/SQL package that belongs to the Oracle Web Agent (OWA) infrastructure shipped with the Oracle database. Its specific role is to manage a session-scoped context value that is subsequently consumed by Virtual Private Database (VPD) — also referred to as Row Level Security (RLS) — policies evaluated during execution of database requests. In the Oracle E-Business Suite 12.1.1 and 12.2.2 environments, this package is part of the supporting database kernel objects on which the EBS technology stack depends, rather than an Application Object Library (AOL) or product-specific API. The package is owned by SYS and is classified in the ETRM metadata as an "OTHER" API, reflecting that it is an internal, infrastructure-level utility rather than a business-facing interface.

Within EBS, VPD is the mechanism used to enforce data isolation and access control — most prominently in the Multi-Org (MOAC) architecture and in the security policies applied to various application tables. The OWA_VPD_CTX package provides a lightweight, package-based state holder through which the current context identifier can be set and retrieved, allowing VPD policy functions to tailor row filtering to the active context.

Key Procedures and Functions

The ETRM metadata documents two program units within the package specification:

  • SET_CTX — A procedure whose purpose is to assign or establish the current VPD context value for the session. As named, the parameter conveys the context value to be stored. It performs no direct DML on application tables; it sets an in-package state variable that is later read by consumers.
  • GET_CTX — A function whose purpose is to return the context value most recently established through SET_CTX. It provides the read side of the context pair, enabling VPD policy predicates and dependent code to obtain the active context without maintaining their own state.

These two units form a symmetric setter/getter pair typical of session-context utilities. No additional procedures or functions are documented for this package.

Tables Accessed

The ETRM metadata records no tables referenced via APPS synonyms for SYS.OWA_VPD_CTX. This is consistent with the package's design: it operates entirely on an internal PL/SQL package variable and does not perform SQL against application or dictionary tables of its own accord. Its effect on data visibility is indirect — it supplies the context that VPD policy functions elsewhere use when generating predicate clauses against protected tables.

Usage Notes

Because the package is owned by SYS and is internal infrastructure, it is not intended for direct invocation by EBS forms, concurrent programs, or typical custom code. The ETRM metadata indicates that the package is referenced by one other package, confirming that its normal use is programmatic consumption by higher-level framework code rather than ad hoc calls from application logic.

In practice, SET_CTX would be invoked by framework or middleware code at the point a session context is established, and GET_CTX would be called by policy functions that need the current value when evaluating access predicates. Developers writing custom VPD policy functions or debugging row-level security behavior may encounter this package indirectly. Direct modification or wrapping of this SYS-owned package is inadvisable, as it is part of the database-supplied toolset and is not covered by EBS patching conventions. Understanding its setter/getter contract is sufficient for diagnosing how a VPD context value flows from session initialization to policy enforcement.