Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Materialized view replication and foreign keys
Hi,
I have set up replication between a master site and a materialized view
(mview) site, both Oracle 9i. Replication initially worked OK, but the
master's foreign key constraints had not been copied to the mview site;
as a result, inconsistent data could be entered in the mview site (and
would cause errors when propagating to the master).
Now I don't know if this was correct, but I created the foreign key
constraints in the mview by issuing a series of ALTER TABLE ... ADD
(CONSTRAINT ... FOREIGN KEY etc.) statements. The mview site then worked
fine, but I can't refresh any more; refreshing causes some foreign key
constraints to be violated (this depends on the order with which mviews
are refreshed; if fk constraints were disabled during refresh and then
re-enabled, the resulting database would be consistent).
Am I missing something painfully obvious? What is the correct way of maintaining copies of the master's fk constraints on the mview?
Thanks! Received on Fri Sep 12 2003 - 07:01:37 CDT