Creating an application context
In this recipe, you'll create a local application context (for example, sh_client
). In the next recipes, you will use it to store clients' identifiers.
Getting ready
To complete this recipe, you'll need an existing user who can create an application context (it needs the CREATE ANY CONTEXT
privilege or a DBA role), for example, the user maja
.
How to do it...
- Connect to the database as a user who has appropriate privileges (for example, user
maja
).$ sqlplus maja
- Create a local application context (for example,
sh_client
).Note
The PL/SQL package that will be used to set application context attributes doesn't have to exist at this time, but you have to specify its name.
SQL> CREATE CONTEXT <context_name> USING <PL/SQL_package_name>;
How it works...
In step 2, you created application context sh_client
and defined that the PL/SQL package sh_ctx_pkg
will be used to create and set application...