Cleaning up CMDB data by using the CI and Relationship Correction Tool option
The CI and Relationship Correction Tool is a command-line utility that helps you to clean-up the data in BMC Helix CMDB.
To reset reconciliation identities
This procedure resets reconciliation IDs to 0, which allows the Reconciliation Engine to assign correct reconciliation IDs during the next reconciliation process.
You might need to reset reconciliation IDs of Configuration Items (CIs) in your source or destination dataset if they are identified incorrectly or if your reconciliation rules are configured incorrectly.
When you reset reconciliation IDs by using the By Class option, IDs of component instances related to weak relationships are also reset. For example, if you reset the IDs of BMC_ComputerSystem instances, the IDs of components such as BMC_DiskDrive and BMC_Monitor that are related to those instances through BMC_HostedSystemComponents relationships are also reset.
- Start the cmdbdiag program.
For information about starting the cmdbdiag program, see Verifying-your-data-model. - At the main menu prompt, type 2.
- At the CI and Relationship Correction Tool submenu prompt, type 1.
- At the By dataset or class prompt, perform the appropriate action:
- To reset reconciliation IDs in all datasets, type class.
- Enter the namespace within which the class exists, or press Enter to accept the default value of BMC.CORE.
- Enter the name of the class.
- Type y to reset reconciliation IDs for all instances of the class, or press Enter to reset the reconciliation ID for specific instances.
- If you are resetting IDs for all instances in the class, skip to the next step. If you are resetting IDs for specific instances, enter the number of instances for which you want to reset the reconciliation IDs.
- Enter the ID of the first instance for which you want to reset the reconciliation ID and follow the prompts to specify each instance that you want to reset.
- To reset reconciliation IDs in a specific dataset, press Enter and provide a dataset ID.
- At the Do you want to continue? prompt, type y to reset reconciliation IDs.
To delete an instance in a dataset
Use this procedure to delete instances that you no longer need, such as datasets created in a test environment. When deleting instances, their relationships are also deleted automatically, to maintain data integrity.
- Start the cmdbdiag program.
For information about starting the cmdbdiag program, see Verifying-your-data-model.
For information on setting the Administrator-Only Mode, see Setting administrative options. - Log in to the AR System server and type 2 at the Main Menu prompt.
- At the CI and Relationship Correction Tool submenu prompt, type 2.
- At the All datasets [y, n] prompt, perform the appropriate action:
- To delete instances in all datasets, type y.
- To delete instances in a specific dataset, press Enter and provide a dataset ID.
To correct invalid relationship instances
Use this procedure to delete relationships for which either of the Configuration Item (CI) endpoints does not exist. For each endpoint of a relationship instance, the program can correct the class ID, dataset ID, and reconciliation ID.
- Start the cmdbdiag program.
- For information about starting the cmdbdiag program, see Verifying-your-data-model.
- Log in to the AR System server and at the main menu prompt, type 2.
- At the CI and Relationship Correction Tool submenu prompt, type 3.
- At the All datasets [y, n] prompt, perform the appropriate action:
- To correct invalid relationship instances in all datasets, type y.
- To correct invalid relationship instances in a specific dataset, press Enter and provide a dataset ID.
- Enter a name for the output file, or press Enter to accept the default file name.
If you enter a file name manually, you must specify an absolute path for the file, for example, C:\CorrectRelationshipsReport.txt. If the file name is not specified correctly, the program saves the report file in the same directory as the cmdbdiag program. - At the Do you want to continue? prompt, type y to correct invalid relationships.
To delete orphan relationships
Use this procedure to delete relationships that might have nonexistent Configuration Item (CI) endpoints.
- Start the cmdbdiag program.
For information about starting the cmdbdiag program, see Verifying-your-data-model. - Log in to the AR System server and at the main menu prompt, type 2.
- At the CI and Relationship Correction Tool submenu prompt, type 4.
- At the All datasets [y, n] prompt, perform the appropriate action:
- To delete orphan relationship instances in all datasets, type y.
- To delete orphan relationship instances in a specific dataset, press Enter and provide a dataset ID.
- Enter a name for the output file, or press Enter to accept the default file name.
If you enter a file name manually, you must specify an absolute path for the file, for example, C:\DeleteOrphanedRelsReport.txt. If the file name is not specified correctly, the program saves the report file in the same directory as the cmdbdiag program. - At the Do you want to continue? prompt, type y to delete orphan relationships.
To delete relationships that violate cardinality
Use this procedure to delete relationships that might have violated the one-to-one, one-to-many, or many-to-one cardinality.
- Start the cmdbdiag program.
For information about starting the cmdbdiag program, see Verifying-your-data-model. - Log in to the AR System server and at the main menu prompt, type 2.
- At the CI and Relationship Correction Tool submenu prompt, type 5.
- At the All datasets [y, n] prompt, perform the appropriate action:
- To delete violated cardinality relationships in all datasets, type y.
- To delete violated cardinality relationships in a specific dataset, press Enter and provide a dataset ID.
- If you want to delete all the instances in violation automatically, type y at the Do you want to automatically delete all instances? [y, n] prompt.
- Type y again to confirm automatically deleting all instances in violation. Otherwise, press Enter to accept the default value of n (no).
The Automatically delete option deletes instances based on their create date and time. The violated instance that is created most recently will be deleted. A copy of the deleted instance is saved in an XML file called <instanceId>.xml in the current directory.
If you type n at the prompt, the list of violated instances is displayed and you are prompted for confirmation before deleting each instance. An XML backup is generated. - Enter a file name for the output file, or press Enter to accept the default file name.
If you enter a file name manually, you must specify an absolute path for the file, for example, C:\FixCardinalityViolations.txt. If the file name is not specified correctly, the program saves the report file in the same directory as the cmdbdiag program.
To delete instances for a given class
Use this procedure to delete instances of a class altogether to clean up data. When you delete instances of a given class, the orphaned weak relationship is also deleted to maintain data integrity.
- Start the cmdbdiag program.
For information about starting the cmdbdiag program, see Verifying-your-data-model. - At the CI and Relationship Correction Tool submenu prompt, type 6.
- At the All datasets [y, n] prompt, perform the appropriate action:
- To delete instance for a class in all datasets, type y.
- To delete instance for a class in a specific dataset, press Enter and provide a dataset ID.
- Enter the namespace name of the class for which you want to delete all instances.
- Enter the class name to which the instances that you want to delete belong.
- At the Do you want to continue prompt, type y to delete all instances of the specified class.
If you type n at the prompt, the CI and Relationship Correction Tool sub-menu is displayed. - Select the orphaned weak member and select Fix or Delete the weak member.
- Select the orphaned weak relations and select Fix or Delete the weak relationship.
To correct orphaned weak members
A weak member of a weak relationship is orphaned when you delete a strong member and leave the weak member of the composite relationship, pointing to a nonexistent CI instance.
You can correct an orphaned weak member of a weak relationship by setting NULL values for the attributes that are propagated from the strong member. When you correct a weak member, it remains in the BMC Helix CMDB as an independent CI instance with no relationships.
If you correct orphaned weak relationships for all datasets, attributes of orphaned instances of all classes are set to NULL.
If you correct orphaned weak relationships of a specific class in any dataset, only the instances of that specific class are corrected.
- Start the cmdbdiag program.
For information about starting the cmdbdiag program, see Verifying-your-data-model. - Log on to the AR System server and at the main menu prompt, type 2.
- At the CI and Relationship Correction Tool submenu prompt, type 7.
- At the Fixing Orphaned Weak Members menu, type 1 to correct orphaned weak members in all datasets. If you want to correct orphaned weak relationship members for a specific class, skip to step 5.
- At the All datasets [y, n] prompt, type y to correct orphaned weak members in all datasets.
- At the Do you want to continue prompt, type y.
- To correct orphaned weak members in a specific dataset, press Enter and provide a dataset ID.
- At the Fixing Orphaned Weak Members menu, type 2 to correct orphaned weak members for a specific class.
- At the All datasets [y, n] prompt, type y to correct orphaned weak members in all datasets.
- To correct orphaned weak members in a specific dataset, press Enter and provide a dataset ID.
- Enter the namespace name of the class for which you want to correct all orphaned weak members.
- Enter the class name to which the orphaned weak members that you want to correct belong.
To delete orphaned weak members
Use this procedure to delete an orphaned weak member of a weak relationship. A weak member of a relationship is orphaned when you delete a strong member and leave the weak member of the composite relationship pointing to a nonexistent CI instance.
- Start the cmdbdiag program.
For information about starting the cmdbdiag program, see Verifying-your-data-model. - Log on to the AR System server and at the main menu prompt, type 2.
- At the CI and Relationship Correction Tool submenu prompt, type 8.
- At the Deleting Orphaned Weak Members menu, type 1 to delete orphaned weak members in all datasets. If you want to delete orphaned weak relationship members for a specific class, skip to step 5.
- At the All datasets [y n] prompt, type y to delete orphaned weak members in all datasets.
- At the Do you want to continue prompt, type y.
- To delete orphaned weak members in a specific dataset, press Enter and provide a dataset ID.
- At the Deleting Orphaned Weak Members menu, type 2 to delete orphaned weak members for a specific class.
- At the All datasets [y, n] prompt, type y to delete orphaned weak members in all datasets.
- To delete orphaned weak members in a specific dataset, press Enter and provide a dataset ID.
- Enter the namespace name of the class for which you want to delete all orphaned weak members.
- Enter the class name to which the orphaned weak members that you want to delete belong.