My Oracle Support Banner

Created Materialized View has COMPILE_STATE = ERROR if it selects from a SYS table (Doc ID 2230316.1)

Last updated on MARCH 10, 2020

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.0 to 12.1.0.2 [Release 11.2 to 12.1]
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.
The materialized view can be selected from and refreshed, but the COMPILE_STATUS is always ERROR

Symptoms

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.

Customer created Materialized View which has COMPILATION_ERROR state.
Problem reproducible on 11.2.0.3, 11.2.0.4 and 12.1.0.2
There are no errors during MVIEW creation,  and the mview refreshes without error.

CREATE materialized VIEW REFER_MV refresh complete ON demand
AS
WITH n AS
(SELECT 'xmlns:xs="<url>/2001/XMLSchema"'NS FROM dual
) ,
m AS
(SELECT t.extract('xs:attribute /@name',n.NS).getStringVal() NAME ,
t.extract('xs:attribute /@type',n.NS).getStringVal() TP ,
xmlType(trim(t.COLUMN_VALUE)) XMLT
FROM n ,
ALL_XML_SCHEMAS s ,

TABLE(XMLSequence(s.schema.extract('/xs:schema/xs:complexType/xs:attribute',n.
NS))) t
WHERE s.schema_url = 'xxx.xsd'
AND s.owner = 'OD'
)
SELECT m.NAME REFER ,
t.extract('xs:enumeration /@value',n.NS).getNumberVal() CODE ,

extractValue(t.extract('xs:enumeration',n.NS),'xs:enumeration/xs:annotation/xs
:documentation',n.NS) NAME
FROM n ,
m ,

TABLE(XMLSequence(extract(m.XMLT,'xs:attribute/xs:simpleType/xs:restriction/xs
:enumeration',n.NS))) t
WHERE m.TP IS NULL;

Changes

 

Cause

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
Symptoms
Changes
Cause
Solution
References


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