Why is Cloud discovery putting MS SQL databases in the cmdb_ci_database table?

KevinD691869774
Tera Contributor
 
5 REPLIES 5

Hi @KevinD691869774 ,

 

Why duplicates can happen

* Cloud Discovery usually discovers the infrastructure hosting the database (e.g., an AWS RDS instance, Azure SQL instance, or a VM running a DB) and creates a CI in a class like cmdb_ci_db_instance (or sometimes cmdb_ci_cloud_database depending on mapping).


* Database Discovery (via JDBC or pattern) discovers the database software instance itself, also creating a CI in cmdb_ci_db_instance or related subclasses.


* If the identifier fields collected by the two discovery sources don’t match exactly (e.g., different names, IP addresses, instance IDs, ports), IRE will treat them as different records, resulting in duplicates.

 

How to prevent duplicates
You need to align identification rules for the Database Instance class so that both discovery sources use the same unique keys.
1. Check the Identification Rule for cmdb_ci_db_instance:
* Go to Identification Rules in ServiceNow.
* Look at the fields in the Identification Entries (often things like instance_name, host, port, vendor).
* Ensure both Cloud Discovery and Database Discovery populate these same fields consistently.


2. Normalize attribute mapping:
* In Discovery Patterns or Cloud Patterns, make sure the output values match in formatting (e.g., same case, no extra domain suffix, consistent port number).
* Sometimes one source reports DBNAME and another dbname.domain.com; normalization fixes this.


3. Use Reconciliation Rules (Data Source precedence):
* In Reconciliation Definitions, set which data source wins for each attribute if both discover the same CI.
* For example, you might let Database Discovery win for version/port attributes, and Cloud Discovery win for hosting relationships.


4. Test in a controlled run:
* Run Cloud Discovery first, then Database Discovery on the same DB.
* Check the Discovery Log and IRE Logs to see if it matched an existing CI or created a new one.
* If new one was created, compare the IRE key fields to see what caused mismatch.


5. Optional – Use Alias Identification Entries:
* If the same DB instance might be referred to differently by different discovery sources, alias rules can link them in IRE.

 

Final answer:
If Cloud Discovery and Database Discovery use the same IRE identification keys for that database instance, you will have only one CI record that gets updated by both. If they use different identifiers (name, host, port mismatch), you’ll end up with two CIs for the same DB — so the fix is to align the Identification Rule and mapping so both discovery sources match the same record.

 

Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.
 

Thank You
AJ - TechTrek with AJ - ITOM Trainer
LinkedIn:- https://www.linkedin.com/in/ajay-kumar-66a91385/
YouTube:- https://www.youtube.com/@learnitomwithaj
Topmate:- https://topmate.io/aj_techtrekwithaj (Connect for 1-1 Session)
ServiceNow Community MVP 2025