Search Results assign_worker_to_run




Overview

APPS.FND_OAM_DSCRAM_RUNS_PKG is an Oracle E-Business Suite server-side PL/SQL package that manages the runtime state of Diagnostic Script Run (DSCRAM) executions. It is declared with AUTHID CURRENT_USER, meaning it executes with the privileges of the calling schema rather than the definer, which is appropriate for a package that inspects session and run state on behalf of the invoking user. The package belongs to the Oracle Application Manager (OAM) diagnostic framework, and its name derives from "Diagnostics Script Run." Its central business function is to coordinate a diagnostic run's lifecycle: initializing run state, assigning a worker session to a run, tracking the statistics row produced by a run's last execution, validating whether execution may start or continue, and preparing a run for resume or retry. The header comment indicates a shipping version dating to 2005 (revision 120.2), which is consistent with the package's presence in both the 12.1.1 and 12.2.2 code lines.

Key Procedures and Functions

The package exposes thirteen documented procedures and functions. Four accessor functions return components of the session's run state: GET_RUN_ID returns the numerical ID of the run to which the session is assigned; GET_RUN_STAT_ID returns the numerical stat ID of the statistics row for the run's last execution; GET_VALID_CHECK_INTERVAL returns the number of seconds before an entity must be revalidated from source; and GET_RUN_MODE returns a string representing the run mode, which governs whether physical work is committed or rolled back. Each of these raises NO_DATA_FOUND when run state has not been initialized by a prior call to ASSIGN_WORKER_TO_RUN.

Argument context handling is provided by three related members: GET_RUN_ARG_CONTEXT retrieves the stored argument context, SET_RUN_ARG_CONTEXT assigns it, and INITIALIZE_RUN_ARG_CONTEXT establishes an initial argument context for the run. This last member is the object most commonly located by the search term "initialize_run_arg_context."

Execution validation is handled by VALIDATE_START_EXECUTION and VALIDATE_CONTINUED_EXECUTION, which gate whether a run may begin or proceed. Lifecycle management is provided by ASSIGN_WORKER_TO_RUN, which initializes run state for a worker session; PREPARE_RUN_FOR_RESUME and PREPARE_RUN_FOR_RETRY, which place a run into a state suitable for resumption or retry; and ADD_LANGUAGE, which registers a language for the run.

Tables Accessed

The package references the following tables through APPS synonyms. FND_OAM_DSCRAM_RUNS_B and its translation table FND_OAM_DSCRAM_RUNS_TL hold the base and language-specific definitions of diagnostic runs, supplying run identity and descriptive text. FND_OAM_DSCRAM_STATS stores the statistics rows that GET_RUN_STAT_ID exposes. FND_LANGUAGES provides the installed-language list consulted by ADD_LANGUAGE. V$DATABASE is queried, most likely to capture database identity and instance metadata as part of run context.

Usage Notes

FND_OAM_DSCRAM_RUNS_PKG is referenced by seven other packages and is typically invoked by the Oracle Application Manager diagnostic framework rather than directly by end users. In a normal session, a worker calls ASSIGN_WORKER_TO_RUN to initialize state, then INITIALIZE_RUN_ARG_CONTEXT or SET_RUN_ARG_CONTEXT to establish parameters, followed by VALIDATE_START_EXECUTION. Accessors such as GET_RUN_ID and GET_RUN_MODE are then used to drive commit or rollback behavior. Custom code should not call these members without first assigning a worker to a run, since the accessors raise NO_DATA_FOUND otherwise.