Duplication of CIs in BMC CMDB
Posted: Tue Nov 02, 2021 9:55 am
Running this query will expose duplicates generated by the defective BMC reconciliation engine and it will show which job had processed it:
Code: Select all
SELECT
rjr.ActivityName,
rjr.z_Tmp_JobName'Job Name',
a.Instanceid,
b.reconciliationidentity,
DATEADD(s,a.createdate,'19700101')'CI Create Date in Asset',
DATEADD(s,rjr.Create_Date,'19700101')'Job Run Date',
DATEADD(s,rjr.Modified_Date,'19700101')'Job End Date',
a.markasdeleted
from BMC_Core_BMC_BaseElement a
join BMC_CORE_BMC_BaseElement b on b.instanceid = a.instanceid
Join RE_JOB_RUns rjr on rjr.Instanceid = a.LastREJobRunId
where a.reconciliationidentity in
(
select ReconciliationIdentity from bMC_CORE_BMC_BaseElement
where datasetid = 'BMC.ASSET' group by ReconciliationIdentity having count(*) > 1
)
and a.datasetid = 'BMC.ASSET' and b.datasetid = 'BMC.ASSET'
Order by reconciliationidentity