Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Materialized View creation with REFRESH FAST

pmAug 7 2013 — edited Aug 9 2013

Hello ,

Please see below case,

TABLE A1(partitioned range+list)

COLUMN C1  -- Primary key

COLUMN C2  -- NUMBER

TABLE D1

COLUMN C1 -- PRIMARY KEY

created MV log as below

CREATE MATERIALIzED VIEW LOG ON A1 WITH ROWID,PRIMARY KEY INCLUDING NEW VALUES;

CREATE MATERIALIzED VIEW LOG ON D1 WITH ROWID,PRIMARY KEY INCLUDING NEW VALUES;


Trying to create MV like below:


CREATE MATERILIZED VIEW mv1test

                                REFRESH FAST ON COMMIT

AS

Select

                                  ...

                                 ....    

FROM A1,

                        D1

                WHERE A1.C1 = D1.CI

AND A1.C2 IS NOT NULL;


It gives below error message:


ORA-12052: cannot fast refresh materialized view schema.mv1test

12052. 00000 -  "cannot fast refresh materialized view %s.%s"

*Cause:    Either ROWIDs of certain tables were missing in the definition or

           the inner table of an outer join did not have UNIQUE constraints on

           join columns.

*Action:   Specify the FORCE or COMPLETE option. If this error is got

           during creation, the materialized view definition may have be

           changed. Refer to the documentation on materialized views.

However ,as discussed in earlier thread i checked all general restrictions of the 'Refresh fast' approach for join.

Restrictions on Fast Refresh on Materialized Views with Joins Only

Defining queries for materialized views with joins only and no aggregates have the following restrictions on fast refresh:

1) They cannot have GROUPBY clauses or aggregates.

2) Rowids of all the tables in the FROM list must appear in the SELECT list of the query.

3)Materialized view logs must exist with rowids for all the base tables in the FROM list of the query.

4)You cannot create a fast refreshable materialized view from multiple tables with simple joins that include an object type column in the SELECTstatement.


As per above restrictions ,

1) Group by clause is not present

2)i do not understand 2nd point , i have added a1.rowid  and d1.rowid in  select statement of MV, but got same error.

3) observed same as 2nd point.

4)we have CLOB column in select list. Tried removing this column but got same error.



Please do let me know any workaround on this.

Thanks in advanced ..

PM

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 6 2013
Added on Aug 7 2013
3 comments
711 views