My Oracle Support Banner

How to use the UNION ALL in a Materialized View for FAST Refresh. Avoiding ora-12015 (Doc ID 1352194.1)

Last updated on NOVEMBER 07, 2019

Applies to:

Oracle Database Backup Service - Version N/A and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.

Goal

NOTE: In the images and/or the document content below, the user information and data used represents fictitious data from the Oracle sample schema(s) or Public Documentation delivered with an Oracle database product.  Any similarity to actual persons, living or dead, is purely coincidental and not intended in any manner.

How to build a Materialized View containing the UNION ALL operator avoiding the error: 

       ORA-12015 when building a fast refreshable mview.

For example. for the invalid setup:

SQL> create snapshot log on <Table_Name_1> ;

Materialized view log created.

SQL> create snapshot log on <Table_Name_2> ;

Materialized view log created.

On the other database where I create my MV

create materialized view <MView_Name> refresh fast as
select * from <Table_Name_1>
  union all
select * from <Table_Name_2> ;

ORA-12015: cannot create a fast refresh materialized view from a complex query

Solution

To view full details, sign in with your My Oracle Support account.

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


In this Document
Goal
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.