ERROR ORA-12054 FOR ON-COMMIT MVIEWS WRITTEN IN ANSI SQL FORMAT (Doc ID 420856.1)

Last updated on JUNE 08, 2015

Applies to:

Oracle Database - Enterprise Edition - Version 9.2.0.1 to 11.2.0.3 [Release 9.2 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 16-FEB-2010***
***Checked for relevance on 22-Sept-2011***


Symptoms

Any on commit materialized view with inner or outer joins and refresh fast, which is written using ANSI SQL format gives following error messages.

As some sample errors it has been observed that materialized views satisfying this condition does not automatically re-compile forcing query rewrite to fail. Or errors during refresh may appear.

create table test_x (a number primary key , b number);
create table test_y (a number primary key, b number);

create materialized view test_mv 
BUILD IMMEDIATE
REFRESH on commit
ENABLE QUERY REWRITE
AS 
select x.a xa
      ,x.b xb
      ,y.b yb
  FROM test_x x
          inner join test_y y
               on (y.a = x.a)
/

ERROR at line 9:
ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view

On releases pre-10gR2, it was also observed error ORA-12015 did occur for on demand mviews.

Error ORA-12015 does not occur for on demand mviews with ANSI SQL from release 10gR2 onwards.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms