Solved

dprop processing failed from Staging to production with below error

Posted on 2013-10-22
7
339 Views
Last Modified: 2014-02-01
Hello,

One of the sub-sets fail with the below error in the Trace files.

Please help me resolve this issue

*** SQL ERROR ***:  SQL0803N  One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "1" constrains table "WCSUSR.ESTIM_WORKFLOW" from having duplicate values for the index key.  SQLSTATE=23505
0
Comment
Question by:jmartin_v
  • 3
  • 2
7 Comments
 
LVL 45

Assisted Solution

by:Kdo
Kdo earned 500 total points
Comment Utility
Hi jmartin,

The message is fairly generic, but it's easy to track down the cause.  Using this as a template, plug in the key values from the error message:

SELECT INDNAME, INDSCHEMA
  FROM SYSCAT.INDEXES
  WHERE IID = <index-id>
  AND TABSCHEMA = 'schema'
  AND TABNAME = 'table'

Open in new window


becomes:

SELECT INDNAME, INDSCHEMA
  FROM SYSCAT.INDEXES
  WHERE IID = 1
  AND TABSCHEMA = 'WCUSR'
  AND TABNAME = 'ESTIM_WORKFLOW'

Open in new window


That will identify the unique index that caused the exception.  Then you need to check your SQL to see why your application was trying to insert duplicate values.  Either an INSERT or UPDATE statement could be at fault.


Good Luck,
Kent
0
 

Author Comment

by:jmartin_v
Comment Utility
Hi Kent,

Thanks for the information, I got the index which was causing the exception.

I am not trying to manually insert/update the records. While Replicating from staging to production, I am getting this error. How can I avoid it? Due to this the entire subscription-set is failing.
0
 
LVL 45

Accepted Solution

by:
Kdo earned 500 total points
Comment Utility
If you're getting this error on the replication system, the data already exists there.  I can only speculate, but there are several ways to generate this error.

-- Identity columns can be problematic when moving data from one database to another.  They are especially aggravating if the sequence is broken by altering the identity with a new start number, increment, etc.

That said, DB2 doesn't check for duplicates in the identity column.  If the error is occurring on the identity column, it's because there is a unique index (scalar or composite) the includes the identity column.  It's still the index validation check that is throwing the error.

-- Is the replication process a standard product or are you trying to replicate the data with your own processes?

It could be that several updates have to occur in the same transaction, (or in separate transactions) to be successful.  Your processes may not be taking that into account.

-- Are all triggers being accounted for?

The replication may require that the trigger be run.  It could also be that the trigger be NOT run since the replication process is copying data and the trigger on the production system would have left the data in the correct state.


What column is throwing the exception?  And how is the column defined?
0
 

Author Comment

by:jmartin_v
Comment Utility
Kdo,

there are 3 columns (Not Null)  defined in the index. there are no identity columns in this table.

Using standard SQL replication process to replicate the data,
0
 
LVL 45

Expert Comment

by:Kdo
Comment Utility
Have you had any system issues?  Outages, errors, etc.  

It's really odd that the replication process would encounter duplicate keys.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now