Exploring and using built-in contexts
The USERENV
application context is a built-in context that contains information about the current session. In this recipe, you'll learn to retrieve values from built-in contexts.
Getting ready
To complete this recipe, you'll need an existing user who can get values from built-in namespaces by using the SYS_CONTEXT
function (for example, user maja
).
How to do it...
- Connect to the database as a user who has appropriate privileges (for example, user
maja
):$ sqlplus maja
- Find the name of host machine from which the client has connected to the database.
- Find the name of the user who logged on to the database.
- Find the name of the program used for the database session.
- Find unified audit session ID.
How it works...
In steps 2-5, you used the SYS_CONTEXT
function to get values of several parameters...