Sunday, 26 July 2015

ORA-30372: fine grain access policy conflicts with materialized view ISSUE :

Receiving the following error when trying to create the materialize view

ORA-30372: fine grain access policy conflicts with materialized view

FINDINGS :

In reference to the following Oracle Metalink note id

Ora-30372: Fine Grain Access Policy Conflicts With Materialized View (Doc ID 604046.1)

We can see such errors in the following scenarios

The issue is described in:
BUG 6952718 - FGAC + MVIEW GIVE ORA-30372 ERRORS EVEN IF USING 10G WORK-AROUNDS
This bug, closed as not being a bug, but the expected behavior is about:
1. table + VPD policies enabled in 10g database
2. remote materialized view in 11g database created against the 10g table.
This always leads to:
ORA-30372 errors
no matter what is the workarounds that used to work in the previous releases.
This is the intended behavior in the 11g release and higher and the error is expected - this restriction is a result of a security enhancement, given that MVs built on remote tables with VPD enabled are unsafe,
In 11g it was initially not possible create or use a materialized view against a remote table with VPD enabled on it. When trying to workaround by applying the VPD after the materialized view creation would also lead to later failures, when refreshing the materialized view.

SOLUTION :
We are able to Create the MV by using the clause USING TRUSTED CONSTRAINTS in the syntax  for example as below

connect user1@inst1
create materialized view mv1
refresh fast with rowid USING TRUSTED CONSTRAINTS
as
select * from emp : table2 @ inst2;

No comments:

Post a Comment