Setting application context attributes

In this recipe, you'll create the PL/SQL package (for example, sh_ctx_pkg) that will set application context attributes for the application context you created in the previous recipe (for example, sh_client). Also, you'll create a logon trigger.

Getting ready

To complete this recipe, you'll need an existing user who can create sh_ctx_pkg. Make sure that the user has direct privileges on the sh.customers table (even if he/she has a DBA role) so that you don't receive this message in SQL*Plus: Warning: Package Body created with compilation errors. or error Table or view doesn't exist in SQL Developer (for more information, see Chapter 3, PL/SQL Security).

How to do it...

  1. Connect to the database as a user who has ...

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.