1

Topic: Dictionary Upgrade Error

Hi All,

I have been trying to bring our species dictionaries up to date and have hit a snag. The import seems to have gone fine and i have been rebuilding the tables.

However, on trying to rebuild the Taxon Name Index it has been crashing and throwing up  the following message;

Violation of PRIMARY KEY constraint 'PK__Index_Taxon_name__5F15B006'. Cannot insert duplicate key in object 'dbo.INDEX_TAXON_NAME'.

Should also mention i upgraded to 6.18 and then tried to update 11-14 which is where i am having the problem in re-building.

Help/advice appreciated!

Ben

Natural History & Biodiversity Data Enthusiast

2

Re: Dictionary Upgrade Error

Can  you please check which Dictionary upgrade R6 thinks you are up to.  R6 Help/About. I am not sure what has happened, which is of concern,  but table Index_taxon_Name is cleared down in each Dictionary upgrade and repopulated when the Index is rebuilt, and nothing has recently changed in the way it is poulated.

Mike Weideli

3

Re: Dictionary Upgrade Error

Hi Mike,

Dictionary version is 00000014

The upgrade itself seemed to have gone fine, as did the rebuilding of Group Index, it was only on running the rebuild of the name index that the problem occurred and i received the error.

The R6 report wizard returns records but with no Taxon or designation attached, though on selecting an individual record it is possible to see the species name so at least the info is still there, i am assuming the problem with the report is just a symptom of the index not being rebuilt.

Natural History & Biodiversity Data Enthusiast

4

Re: Dictionary Upgrade Error

If it is just a case of clearing the contents of the primary key would it be worth me attempting to do this manually then trying the re-build again?

Natural History & Biodiversity Data Enthusiast

5

Re: Dictionary Upgrade Error

Script 14 should  clear down the index tables.  Could you see in you have anything in table Index_Taxon_Name ?

Mike

Mike Weideli

6

Re: Dictionary Upgrade Error

Yes this table contains data, the column "Taxon list item key" which appears to be based on the PK_.. key(?) also have values

Natural History & Biodiversity Data Enthusiast

7

Re: Dictionary Upgrade Error

Can you just delete the contents of the table. If you have management studio the query is

TRUNCATE TABLE  INDEX_TAXON_NAME

If  not change the Dict Seq in the settings table to 00000013 and run the dictionary upgrade again. 

If the rebuild of the taxon name index doesn't work after that we will need to dig a bit deeper. Perhaps Index_taxon_name is only partly being populated  and is failing at a point wherea duplicate key is being found, but I have never seen this before.



Mike

Mike Weideli

8

Re: Dictionary Upgrade Error

The query worked and cleared the table. However the rebuild has failed with the same error.

I did the group re-build again first, was this a mistake?

Natural History & Biodiversity Data Enthusiast

9

Re: Dictionary Upgrade Error

It shouldn't matter about the order apart from the fact that index_taxon_designation has to be done last. I assume that after the truncate the table is empty, but that after the rebuild it some data in it, but not the 500,000 rows which there should be ?

Mike Weideli

10 (edited by BDeed 21-03-2013 13:13:36)

Re: Dictionary Upgrade Error

Query returned 474,392 table entries/rows

Natural History & Biodiversity Data Enthusiast

11

Re: Dictionary Upgrade Error

I attach the SQL which populates Index_Taxon_Name.  I would be grateful if you could run this in management studio to see where the process is failing.

Post's attachments

SQLPopulateIndexTaxonName.sql 31.86 kb, 2 downloads since 2013-03-21 

You don't have the permssions to download the attachments of this post.
Mike Weideli

12 (edited by BDeed 21-03-2013 18:23:57)

Re: Dictionary Upgrade Error

The below 'message' was produced by Studio..


 (25015 row(s) affected)

(25047 row(s) affected)

(25016 row(s) affected)

(24952 row(s) affected)

(25016 row(s) affected)

(25016 row(s) affected)

(25001 row(s) affected)

(24961 row(s) affected)

(24983 row(s) affected)

(25009 row(s) affected)

(24683 row(s) affected)

(25015 row(s) affected)

(25014 row(s) affected)

(25016 row(s) affected)

(25016 row(s) affected)

(25015 row(s) affected)

(25010 row(s) affected)

(15586 row(s) affected)

(9426 row(s) affected)

(24592 row(s) affected)

(3 row(s) affected)
Msg 2627, Level 14, State 1, Line 2
Violation of PRIMARY KEY constraint 'PK__Index_Taxon_name__5F15B006'. Cannot insert duplicate key in object 'dbo.INDEX_TAXON_NAME'.
The statement has been terminated.

(1 row(s) affected)

(474392 row(s) affected)

(9907 row(s) affected)

(57195 row(s) affected)

(0 row(s) affected)

(474277 row(s) affected)

(34 row(s) affected)

(6 row(s) affected)

(109 row(s) affected)

(474392 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)

(0 row(s) affected)
Natural History & Biodiversity Data Enthusiast

13

Re: Dictionary Upgrade Error

By working through it looks like the  following may be where the problem is.  Please could you run this select statement. I don't think it will produced many rows and if it doesn't send me the results. If it is too large for this please could you have a look down and see if there is anything which stands out as a duplicate or which is different.

SELECT TLI.Taxon_List_Item_Key, TLI.Taxon_List_Version_Key,   TUN.Item_Name, CASE WHEN TR3.List_Font_Italic = 1 AND TUN.Language = 'La' THEN 1 ELSE 0 END,   T2.Item_Name, CASE WHEN TR3.List_Font_Italic = 1 AND T2.Language = 'La' THEN 1 ELSE 0 END,   T3.Item_Name, CASE WHEN TR3.List_Font_Italic = 1 AND T3.Language = 'La' THEN 1 ELSE 0 END,   0
FROM Taxon_User_Name AS TUN LEFT JOIN Taxon_List_Item AS TLI ON TLI.Taxon_List_Item_Key = TUN.Taxon_List_Item_Key LEFT JOIN Taxon_version AS TV ON TV.Taxon_Version_Key = TLI.Taxon_Version_Key LEFT JOIN Taxon_Common_Name AS TCN ON TCN.Taxon_List_Item_Key = TLI.Taxon_List_Item_Key LEFT JOIN Taxon_Version AS TV2 ON TV2.Taxon_Version_Key = TCN.Taxon_Version_Key LEFT JOIN Taxon AS T2 ON T2.Taxon_Key = TV2.Taxon_Key
LEFT JOIN Taxon_List_Item AS TLI3 ON TLI3.Taxon_List_Item_Key = TLI.Preferred_Name LEFT JOIN Taxon_Rank AS TR3 ON TR3.Taxon_Rank_Key = TLI3.Taxon_Rank_Key LEFT JOIN Taxon_Version AS TV3 ON TV3.Taxon_Version_Key = TLI3.Taxon_Version_Key LEFT JOIN Taxon AS T3 ON T3.Taxon_Key = TV3.Taxon_Key WHERE TLI.Taxon_List_Version_To IS NULL

Mike Weideli

14

Re: Dictionary Upgrade Error

Hi Mike,

It found a single row. Details;

Taxon_List_Item_Key         DSS005640000000S
Taxon_List_Version_Key     LC00000100000001   
Item_Name                       Malva x clementii
(No column name)               0
Item_Name                       Malva x clementii
(No column name)               0
Item_Name                       Malva x clementii
(No column name)               0
(No column name)               0

Do you have an idea as to the problem?

Natural History & Biodiversity Data Enthusiast

15

Re: Dictionary Upgrade Error

It looks like something in the dictionary, which is to do with user added taxa.  If it is it is some combination of things we haven't come across before and probably just one taxa causing the whole problem. I will run some more tests in a minute and get back to you.

Mike

Mike Weideli

16 (edited by BDeed 22-03-2013 10:26:35)

Re: Dictionary Upgrade Error

Hi Mike,

Thanks for your call, unfortunately it was not to be, i ran the synonym rebuild and received the following:

exception message : Could not allocate space for object 'dbo.INDEX_TAXON_SYNONYM'.'IX_INDEX_TAXON_SYNONYM' in database 'NBNData' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

This however might hint at a different problem?

Interestingly rebuilding the synonym index again broke the name index (trying to rebuild the designation also throws up a similar error to the above).

I have re-run the SQL as previously discussed and this repairs the name index.

Natural History & Biodiversity Data Enthusiast

17

Re: Dictionary Upgrade Error

I think is a space issue somewhere. Either in the SQL Server configuration or in the available space on the  file server.  Your problem with Index_taxon_name seems to be down to having an Index on Taxon_List_Item_Key, which shouldn't be there. I am trying to establish how this could have got there - possibly it was there once and an upgrade has failed to remove it. I think it will be safe to remove the index, but have asked JVB to confirm my thinking.

Mike Weideli

18

Re: Dictionary Upgrade Error

Thanks Mike for your support.

To sum,

the anomalous key has now been deleted and i have run a few wizard based R6 reports without issue. Everything seems to be running along happily..

the issue regarding space appeared fixed by changing NBNData > properties > files; auto-growth field from 50 percent to 10MB though why this should make a difference i may never know!

I think this forum needs a solved tag!

Thanks again,

Ben

Natural History & Biodiversity Data Enthusiast