Starting and stopping privilege analysis
To start capturing privileges, you'll enable privilege analysis policies you created in the previous recipes.
Getting ready
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.
How to do it...
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...