In certain conditions, the error below may be thrown:
Server: Msg 2627, Level 14, State 1, Procedure spConvertRAHistToSnapshotHist, Line 434 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 Cost Center Owner percentages for a resource, the percentages will be evenly split between all Cost Center Owners for the resource. For example, you manually add two Cost Centers to a resource and split the ownership percentages at 40 and 60 percent respectively; those percentages will become 50 and 50 percent after completing the following steps:
Back up the Altiris database.
Run the following SQL script against the Altiris database:
--remove all entries from inv_cost_center_ownership TRUNCATE TABLE Inv_Cost_Center_Ownership
--remove all entries from invhist_cost_center_ownership TRUNCATE TABLE InvHist_Cost_Center_Ownership
--remove all records from ResourceInventoryHistory table for inv_cost_center_ownership class DELETE FROM ResourceInventoryHistory WHERE InvClassGuid = '4aafad02-4ef3-48ef-82e6-6822a82f8da5'
--remove all records from ResourceUpdateSummary table for inv_cost_center_ownership class DELETE FROM ResourceUpdateSummary WHERE InventoryClassGuid = '4aafad02-4ef3-48ef-82e6-6822a82f8da5'