Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

dprop processing failed from Staging to production with below error

Posted on 2013-10-22
7
Medium Priority
?
361 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 46

Assisted Solution

by:Kent Olsen
Kent Olsen earned 2000 total points
ID: 39593920
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
ID: 39594370
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 46

Accepted Solution

by:
Kent Olsen earned 2000 total points
ID: 39594411
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
ID: 39596309
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 46

Expert Comment

by:Kent Olsen
ID: 39597574
Have you had any system issues?  Outages, errors, etc.  

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

Featured Post

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

721 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