Friday, June 29, 2012

ORA-24134 and ORA-12015, on Materialized View

If you create a Materialized View:

CREATE MATERIALIZED VIEW WLI_QS_REPORT_MAT_VIEW refresh fast as select * from WLI_QS_REPORT_ATTRIBUTE;

you get a
"ORA-23413: table "CMDB"."WLI_QS_REPORT_ATTRIBUTE" does not have a materialized view log"

so you do:

create materialized view log on WLI_QS_REPORT_ATTRIBUTE;

and now your MATERIALIZED VIEW refresh fast can be created.

Suppose now you create a VIEW on WLI_QS_REPORT_ATTRIBUTE:

create or replace view WLI_QS_REPORT_VIEW as select * from WLI_QS_REPORT_ATTRIBUTE;

CREATE MATERIALIZED VIEW WLI_QS_REPORT_MAT_VIEW refresh fast as select * from WLI_QS_REPORT_VIEW;


you get:
ORA-12015: cannot create a fast refresh materialized view from a complex query
Reissue the command with the REFRESH FORCE or REFRESH COMPLETE option or create a simple materialized view.

If you want to create the Materialized View Fast Refresh, you should create it directly on the table, not on a view


http://www.sqlsnippets.com/en/topic-12882.html

No comments: