Confluence 6 "Duplicate Key" 相關問題解決

若是你遇到了下面的錯誤信息,例如:java

could not insert: [bucket.user.propertyset.BucketPropertySetItem#bucket.user.propertyset.BucketPropertySetItem@a70067d3]; SQL []; Violation of PRIMARY KEY constraint 'PK_OS_PROPERTYENTRY314D4EA8'. Cannot insert duplicate key in object 'OS_PROPERTYENTRY'.; nested exception is java.sql.SQLException: Violation of PRIMARY KEY constraint 'PKOS_PROPERTYENTRY_314D4EA8'. Cannot insert duplicate key in object 'OS_PROPERTYENTRY'.

這個錯誤信息說的是定義爲'PK_OS_PROPERTYENTRY_314D4EA8' 的主鍵在表 'OS_PROPERTYENTRY' 中重複了。
你能夠在 'OS_PROPERTYENTRY'  表中找到 'PK_OS_PROPERTYENTRY_314D4EA8' 中定義的主鍵,而後找到重複的值後刪除重複的值。須要肯定  "PRIMARY KEY" 必須保持不重複。一個能夠找到 'OS_PROPERTYENTRY' 表中是否有重複主鍵的 SQL 以下:sql

SELECT ENTITY_NAME,ENTITY_ID,ENTITY_KEY,COUNT(*) FROM OS_PROPERTYENTRY GROUP BY ENTITY_NAME,ENTITY_ID,ENTITY_KEY HAVING COUNT(*)>1


https://www.cwiki.us/display/CONFLUENCEWIKI/Troubleshooting+XML+backups+that+fail+on+restore
相關文章
相關標籤/搜索