While doing some reporting for Cisco switch stacks, I am finding switches that used to be stacked and were replaced, but the name/IP was used so the nodeID didn't get changed and Orion is retaining stale switch stack data and messing up switch stack reports. Can records with old LastSync dates in the NPM_SwitchStack table be deleted from the database? This seems like the kind of thing that database maintenance should be removing automagically based on some sort of retention.
Query used to find stale switch stack data, with results below....
/****** Script for SelectTopNRows command from SSMS ******/
SELECT TOP (1000) S.[NodeID],
-- N.Caption,
[MasterNumber]
,[DataRingRedundant]
,S.[Status]
,S.[StatusDescription]
,[DataRingStatus]
,[PowerRingStatus]
,S.[LastSync]
,[RingFailure]
,[MemberPortsHashCode]
FROM [SolarWindsNPM].[dbo].[NPM_SwitchStack] S
-- JOIN Nodes N on S.NodeID=N.NodeID
Where S.status = 2 and S.[LastSync] < DateAdd (Month,-6, GETDATE ())
