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...

  1. Connect to the database as a user who has appropriate privileges (for example, user maja).
    $ sqlplus maja
    
  2. 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>; ...

Get Oracle Database 12c Security Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.