How to query to SYSMAN.MGMT$ views with custom user

When you try to select from Enterprise Manger Cloud Control(EM)’s managemnt views, known as MGMT$views, query returns with no rows, although you give access privileges to user.
Reason is VPD. OEM repository (SYSMAN) uses VPD policies. So you need to exempting the custom user from VPD policies. Lets exempt personal/custom user from access policies.

grant EXEMPT ACCESS POLICY to <username>;

now grant select all mgmt$ views to custom/personal user;

grant MGMT_USER to <username>;

or you can grant only specified views;

grant select on MGMT$STORAGE_REPORT_DATA TO <USERNAME>;

now, queries to mgmt$ returns data, of course it has any data 🙂

Leave a comment