SQL Quarantined Data

Historical Data is occasionally being quarantined in my project, and I’m wondering if any of you have any ideas about where I should begin troubleshooting this…

I’m using MSSQL. The “reason” is…

Violation of PRIMARY KEY constraint 'PK__sqlt_dat__BE126DD153A94FE8'. Cannot insert duplicate key in object 'dbo.sqlt_data_1_2017_06'. The duplicate key value is (752, 1498065282245).

I found the referenced entry in the database, and the value there is NULL with a dataintegrity 600. I found the entry in the quarantine export, and it does have a value and good quality associated with it.

Any thoughts?

Well, the timestamp for history is raw unix milliseconds, so you are encountering tags that are switching to null/bad quality and back to good in the same millisecond. History is keyed on the tag id and the timestamp, so you can’t write the good value after the bad.
The real question is how are you getting tags to update twice in the same millisecond?

Along these lines:
Have you ever set up a test or development gateway? Something running a (possibly old) backup of your primary system?

I’m not really sure how the tags are updating twice. I’ve been looking through the settings, but I don’t see anything that might cause it.

Not exactly. However, this scada is being deployed on multiple similar sites, (so far two, but more to come), and the two current sites have the same issue.

Are those two sites pointing to the same DB server?

If so did you use a GW backup to create the second GW?

The way Phil and Paul ask the questions, I wonder if maybe you have two GWs with the same name sending history to the same DB server.

1 Like

Good question, I wasn’t clear on that. The two sites have separate DBs and are on separate networks.