Oracle Error QSM-02180: no primary key constraint in the master table

Oracle Error Message

QSM-02180: no primary key constraint in the master table

Reason for the Error

The explain_mview assumes that the materialized view is going to be created as the Primary Key materialized view. A Primary Key materialized view can not be created if the base table does not have a primary key constraint.

Solution

Add a primary key constraint to the base table, or create the materialized view as Rowid MV by specifying the WITH ROWID option. If the materialized view is a Rowid MV, then it should be able to do complete refresh and even fast refresh, given that the materialized view log on the master table has a rowid.