How to Manually Remove A Connector From SOI

Document ID : KB000100979
Last Modified Date : 13/06/2018
Show Technical Document Details
Introduction:
How to manually remove a connector from SOI when you can't use the Remove option in the Administration tab or use the SOITOOLBOX utility.
Background:
The SCOM connector had a bad policy file that included the InstanceName value for all classes including ComputerSystsm, VirtualSystem, etc.
SOI will use the InstanceName field to perform the correlation if it exist.
As a result the CIs from SCOM are not being correlated with existing CIs from other connectors like UIM, Spectrum.
This created duplicate or separate SCOM CIs. 
Environment:
SOI 4.0 SP2
Instructions:
For this example, we will remove the SCOM connector and use ConnectorID 50
Replace CA:00031 in the example with the connector you are going to remove like CA:00050 for UIM.

select distinct c_mdrprodinstance from ca_ssa_ci_detail where c_mdrproduct = 'CA:00031'
You will need the result from the above query for later queries.

The ConnectorID of the connector you are going to remove which is located in the ConnectorConfiguration  table.

1) Stop all SOI services (Manager, UI, Connector) 

2) Ran the following SQL queries... 

if exists(select 1 from CIStaging s where s.ciid is not null AND s.ConnectorID = 50) begin 
update ci set USMNotebookID = null, USMSheetID = null where ciid in (select ciid from CIStaging where ConnectorID = 50) 
end 

delete from ca_ssa_ci_detail where c_mdrproduct = 'CA:00031' and c_mdrprodinstance = 'P006P0153:16161' 

delete from AlertHistory where AlertID in (select a.AlertID from AlertHistory a, Alerts b where a.AlertID = b.AlertID and b.ConnectorID not in (select cc.ConnectorID from ConnectorConfiguration cc) and b.ConnectorID != '0') 

delete from AlertImpact where AlertID in (select a.AlertID from AlertImpact a, Alerts b where a.AlertID = b.AlertID and b.ConnectorID not in (select cc.ConnectorID from ConnectorConfiguration cc) and b.ConnectorID != '0') 

delete from Alerts where ConnectorID = 50 

delete from AlertQueueAssignments where AlertID not in (select a.AlertID from Alerts a) 

delete from OutageAlerts where AlertID not in (select a.AlertID from Alerts a) 

delete from OutageQualityAlerts where AlertID not in (select a.AlertID from Alerts a) 

delete from OutageRiskAlerts where AlertID not in (select a.AlertID from Alerts a) 

3) Restart all SOI services.