Dokumentationen viser "Begrænsninger for hurtig opdatering af materialiserede visninger med aggregater" :
Du skal inkludere alle de kolonner, der bruges i din MV i loggene, f.eks.:
CREATE MATERIALIZED VIEW LOG ON MV_LLATTRDATA_PARTITIONED_TEST
WITH ROWID, SEQUENCE(ID, DEFID, ATTRID, VERNUM, DEFVERN) INCLUDING NEW VALUES;
CREATE MATERIALIZED VIEW LOG ON DTREECORE
WITH ROWID, SEQUENCE(DATAID) INCLUDING NEW VALUES;
Derefter kan du oprette MV:
CREATE MATERIALIZED VIEW MV_LLATTRDATA_MAX_VERSIONS
NOLOGGING
BUILD IMMEDIATE
REFRESH FAST ON COMMIT
ENABLE QUERY REWRITE
AS
SELECT AD.DEFID, AD.ATTRID, MAX(AD.VERNUM) AS MAX_VERNUM, MIN(AD.DEFVERN) AS MAX_DEFVERN
FROM MV_LLATTRDATA_PARTITIONED_TEST AD, DTREECORE DT
WHERE AD.ID = DT.DATAID
GROUP BY AD.DEFID, AD.ATTRID;
Materialized view MV_LLATTRDATA_MAX_VERSIONS created.
Ikke den mest nyttige fejlmeddelelse...