Context Attribute Definition or Usage Issues

Troubleshoot issues related to creating, validating, and using end-user context attributes.

Topics:

Cannot Create a Context Attribute Definition Object

If the CREATE END USER CONTEXT statement fails, the executing user may lack the required privilege or the JSON schema payload may be invalid.

Issue description

The CREATE END USER CONTEXT statement fails when the administrator attempts to create a custom end-user context attribute definition.

Probable causes

Resolution procedure

  1. Verify that the CREATE END USER CONTEXT privilege has been granted to the executing user.

  2. Ensure that the JSON schema payload conforms to valid JSON syntax.

Context Attribute Cannot Be Used in Session

If a defined context attribute cannot be read or updated within a session, the attribute definition may be misconfigured, the required privileges may not be granted, or the associated PL/SQL callbacks may be invalid.

Issue description

A context attribute that has been defined cannot be read or updated within an end-user session. Queries or data grant predicates that reference the attribute fail or return unexpected results.

Probable causes

Resolution procedure

  1. Confirm that the context attribute definition exists and is correctly configured by querying the DBA_END_USER_CONTEXT_DEFINITIONS view.

  2. Verify that the SELECT privilege (and the UPDATE privilege, if the attribute must be writable) on the specific end-user context has been granted to the end user through a data grant or as a system privilege.

  3. If PL/SQL callbacks are used to load the attribute value, verify the following:

    • The PL/SQL package and procedure referenced in the context definition are valid.

    • The EXECUTE privilege on the PL/SQL package has been granted to the appropriate user or role.

  4. If the issue persists, enable diagnostic tracing and examine the trace output. See Enable Diagnostic Tracing.