Materialized View Creation on Prebuilt Table Fails with ORA-12060 (Doc ID 1379574.1)

Last updated on JULY 07, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.4 to 11.2.0.2 [Release 10.2 to 11.2]
Information in this document applies to any platform.

Symptoms

SQL>create table
MV_RPCA_RTG_PRE_COST_AGG (
ROUTE_CD number);

SQL> create table MV_RCSM_RTG_PFRM_COST_SUM_X
AS
SELECT CUR_MIN_ROUTE_CD
FROM
( SELECT ROUTE_CD AS CUR_MIN_ROUTE_CD
FROM MV_RPCA_RTG_PRE_COST_AGG
) RCSM;

SQL> CREATE MATERIALIZED VIEW MV_RCSM_RTG_PFRM_COST_SUM_X
--BUILD DEFERRED
ON PREBUILT TABLE WITH REDUCED PRECISION
AS
SELECT CUR_MIN_ROUTE_CD
FROM
( SELECT ROUTE_CD AS CUR_MIN_ROUTE_CD
FROM MV_RPCA_RTG_PRE_COST_AGG
) RCSM;

ERROR at line 5: ORA-12060: shape of prebuilt table does not match definition query



No such problem(error) if the column wasn't aliased.

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