Oracle 12c Privilege Analysis – Capture Privilege Usage

Installation
CREATE USER AXXANA IDENTIFIED BY AXXANA;
GRANT DBA, RESOURCE TO AXXANA;

A user-defined condition, when user is AXXANA (type = G_CONTEXT):
BEGIN
DBMS_PRIVILEGE_CAPTURE.create_capture ( name => 'axxana_pol', TYPE => DBMS_PRIVILEGE_CAPTURE.g_context, condition => 'SYS_CONTEXT(''USERENV'', ''SESSION_USER'') = ''AXXANA''' );
DBMS_PRIVILEGE_CAPTURE.enable_capture ( 'axxana_pol' );
END;
/

Verify that the capture is defined and enabled:
COLUMN ROLES FORMAT a20
COLUMN CONTEXT FORMAT a30
COLUMN ENABLED FORMAT a7
SELECT name
, TYPE
, enabled
, roles
, context
FROM dba_priv_captures
ORDER BY name;

Work with user AXXANA (run agent).
Stop the capture and generate the results:

BEGIN
DBMS_PRIVILEGE_CAPTURE.disable_capture ( 'axxana_pol' );
DBMS_PRIVILEGE_CAPTURE.generate_result ( 'axxana_pol' );
END;
/

Query system privileges results:

SELECT username, sys_priv
FROM dba_used_sysprivs
WHERE capture = 'axxana_pol'
ORDER BY username, sys_priv;

Query object privileges results:
SELECT username
, obj_priv
, object_owner
, object_name
, object_type
FROM dba_used_objprivs
WHERE capture = 'axxana_pol';

Investigate system privileges:

SELECT username
, sys_priv
, used_role
, PATH
FROM dba_used_sysprivs_path
WHERE capture = 'axxana_pol'
ORDER BY username, sys_priv;

Investigate object privileges:

SELECT username
, obj_priv
, object_owner
, object_name
, used_role
, PATH
FROM dba_used_objprivs_path
WHERE capture = 'axxana_pol';

At the end, drop the capture definition:
BEGIN
DBMS_PRIVILEGE_CAPTURE.drop_capture ( 'axxana_pol' );
END;
/

Source
https://oracle-base.com/articles/12c/capture-privilege-usage-12cr1
https://www.toadworld.com/platforms/oracle/b/weblog/archive/2015/12/29/oracle-12c-privilege-analysis