Dropping the analysis
In this recipe, you'll drop an existing privilege analysis policy. It has to be disabled before dropping; otherwise, you'll receive an error.
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 and an existing privilege analysis policy.
How to do it...
Connect to the database as system or a user who has appropriate privileges:
$ sqlplus system
Drop a privilege analysis policy (for example,
ALL_PRIV_POL
, which you created in the first recipe in this chapter):SQL> BEGIN SYS.DBMS_PRIVILEGE_CAPTURE.DROP_CAPTURE( name => '<policy_name>'); END; /
Verify that all the records about the used and unused privileges, which have been gathered according to the policy, are also dropped:
SQL> SELECT username, sys_priv, obj_priv, object_owner, object_name FROM DBA_USED_PRIVS WHERE capture...