VaranAwesomenow
Mega Sage

Symptoms

When there are duplicate records in CMDB for a given CI.

When a new data load is performed ServiceNow may not update the exact record you want.

Diagnosis

Look at the duplicate CIs.

Identify the record that needs to be retained and records that needs to be retired since they are duplicates.

Change the identification attributes to values so that IRE wont identify them as valid record.

Rerun data load.

you will observe that in some cases IRE will update duplicate record.

Solution

sys_object_source table stores references to CIs that need to be updated for a given identification attribute.

When this happens it ties together the ID and CI reference (via sys_id).

In order to fix this issue there are two options

1. Delete records in sys_object_source that have target_sys_id as invalid.

2. Update sys_object_source records to have target_sys_id as reference to the record that you think is the valid record.

Sample script :

var counter = 0;
var grOs = new GlideRecord('sys_object_source');
var queryOs = 'target_sys_idINxxyyyzzzzzzzzzzz'; //sys_ids of bad records or duplicate records.
grOs.addEncodedQuery(queryOs);
//grDc.setLimit(1);
grOs.query();
while(grOs.next()) {
counter++;
grOs.deleteRecord();
}
gs.print(counter);

Comments
VenniMakarainen
ServiceNow Employee
ServiceNow Employee

How about looking into managing the duplicate CIs while ensuring auditability to actions taken? https://docs.servicenow.com/bundle/tokyo-servicenow-platform/page/product/configuration-management/c...

VaranAwesomenow
Mega Sage

@VenniMakarainen thanks for your response.
Sure, since we dont delete data from CMDB, if we identify a duplicate and mark that as a duplicate record, sys_object_source stores reference to a CI, hence it needs to be refreshed either to point to correct CI or delete them in order for next IRE load to update the correct record.

Version history
Last update:
‎10-16-2022 12:05 AM
Updated by:
Contributors