In certain conditions, the error below may be thrown:
Server: Msg 2627, Level 14, State 1, Procedure spConvertRAHistToSnapshotHist, Line 373 Violation of PRIMARY KEY constraint 'PK_ResourceUpdateSummary'. Cannot insert duplicate key in object 'ResourceUpdateSummary'. The statement has been terminated.
This is primarily an issue of timing.
By default in CMDB Solution 6.5, there is a Clean Ownership task scheduled to run at 10:00 a.m. and 10:00 p.m., which does some of the same work being done in step 4 in article 37874.
Having this task execute at any time between steps 2 and 4 of article 37874 can cause this issue to occur.
To prevent this issue from occurring, perform the resolution in article 37874 in a time frame such that the Clean Ownership task will not automatically run between steps 2 and 4.
If this issue has already occurred, use the following steps to recover the database to a valid post-upgrade state:
Important: If after this issue has occurred you have manually set any Asset User Owner percentages for a resource, the percentages will be evenly split between all Asset User Owners for the resource. For example, you manually add two Owners to a resource and split the ownership percentages at 40% and 60% respectively; Those percentages will become 50% and 50% after completing the following steps:
Backup the Altiris database.
Run the following SQL script against the Altiris database:
--remove all entries from inv_ownership_details TRUNCATE TABLE inv_ownership_details
--remove all entries from invhist_ownership_details TRUNCATE TABLE invhist_ownership_details
--remove all records from ResourceInventoryHistory table for inv_ownership_details class DELETE FROM ResourceInventoryHistory WHERE InvClassGuid = '0cd0318b-ad51-4d38-8ea3-2612d12189de'
--remove all records from ResourceUpdateSummary table for inv_ownership_details class DELETE FROM ResourceUpdateSummary WHERE InventoryClassGuid = '0cd0318b-ad51-4d38-8ea3-2612d12189de'