Delete large number of duplication of CI's (computer)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 11:28 PM
Hi,
I need to delete duplicates of cmdb_ci_computer. It is having large number of records. But The difficult part is I don't know the unique column to identify. Because the name of the CI having many serial numbers, IP address etc...As the name also it has many records. I am not sure about the correlation ID. The correlation ID may be unique. So I need the column i.e Install Status should not retired. So Kindly help on this and provide me a solution.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 11:35 PM
Hi @Service now11 ,
Deleting duplicate records of cmdb_ci_computer where the Install Status is not retired can be challenging without a clear unique identifier. However, you can use a combination of fields to identify potential duplicates and then decide on a strategy to delete them. Here's a general approach:
-
Identify potential unique identifiers: Review the structure of the cmdb_ci_computer table and analyze which combination of fields could potentially serve as unique identifiers. Look for fields that are less likely to have duplicates, such as serial number, model ID, or manufacturer.
-
Write a query to identify potential duplicates: Use the identified fields to group records and count the number of occurrences. This will help you identify potential duplicates.
-
Analyze the results: Review the results of your query to determine which records are likely duplicates. Pay attention to fields like name, serial number, and other identifying information.
-
Decide on a deletion strategy: Once you've identified potential duplicates, decide on a strategy for deleting them. This could involve keeping only one record for each unique combination of identifiers or selecting a single record based on criteria such as creation date or correlation ID.
-
Test your deletion strategy: Before executing any deletion commands, test your strategy in a non-production environment to ensure it produces the desired results and does not unintentionally delete important data.
-
Execute the deletion: Once you're confident in your deletion strategy, execute the necessary SQL commands to delete the duplicate records from the cmdb_ci_computer table.
Thanks,
Ratnakar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 01:26 AM
Refer my article : ServiceNow Duplicate CIs Solution / Script / Report
I hope this helps...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....