To start capturing privileges, you'll enable privilege analysis policies you created in the previous recipes.
You'll need an existing user who can manage privilege analysis policies (has the CAPTURE_ADMIN
role and the SELECT ANY DICTIONARY
privilege), for example, the SYSTEM
user.
Connect to the database as system or a user who has appropriate privileges:
$ sqlplus system
List all existing privilege analysis policies by querying
DBA_PRIV_CAPTURES
.Enable a privilege analysis (for example,
ALL_PRIV_POL
, which you created in the first recipe in this chapter):SQL> BEGIN SYS.DBMS_PRIVILEGE_CAPTURE.ENABLE_CAPTURE( name => '<policy_name>'); END; /
Connect to the database as the user
alan
and view the first names of employees who have salary less than1000
:Find first names of employees...