In this recipe, create VPD policies as part of a policy group.
To complete this recipe, you'll need an existing user who has appropriate privileges (for example, maja
). If you completed previous recipes, drop all VPD policies using the DBMS_RLS.DROP_POLICY
procedure.
Connect to the database as a user who has appropriate privileges (for example, the user
maja
):$ sqlplus maja
Add
TEST_POL1
to policy grouppol_grp_A
.Add
TEST_COL
to policy grouppol_grp_A
.Add
TEST_POL2
to policy grouppol_grp_B
.Create a logon trigger.
Connect to the database as the user
joel
using SQL*Plus and execute theSELECT
statement, as shown in Figure 32.View data in the table
hr.emp_vpd_test
.Connect to the database as the user
susan
using SQL*Plus and view data in the tablehr.emp_vpd_test
:SQL> connect susan
Connect as the user
emma
using SQL Developer and view data in the tablehr.emp_vpd_test
.