Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Materialized view - Primary key violated

607350Apr 4 2012 — edited Apr 6 2012
Hi All,

We have a materialized view on one system which pulls data from another system (both Oracle 11g) over a db link. However, it recently stopped working.

Any attempt to create a materialized view on the source table results in the following error:

ORA-02437: cannot validate (APNEW.XPKSTR_STORE1) - primary key violated

There is a primary key on the source table but it doesn't have the 1 at the end. There are no duplicates in the source table.

The query is (from dev system to production):

CREATE MATERIALIZED VIEW apnew.test_str
REFRESH FAST ON DEMAND AS
SELECT
prod_cd,
store_cd,
fcst_start_dt,
fcst_stop_dt,
pl_start_dt,
pl_stop_dt,
rade_cd,
store_grp_cd,
store_grp_nm,
do_not_override_ind,
last_mod_dt,
last_mod_userid
FROM apnew.str_store@D2P;

prod_cd and store_cd are the primary key in the source table.

Anyone have an idea what might be going on?

Thanks!
John
This post has been answered by Hemant K Chitale on Apr 5 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 4 2012
Added on Apr 4 2012
12 comments
2,424 views