How to Use the Database Tool in UCMDB, this tool comes with the product.
Universal CMDB provides a tool for modifying the database directly without accessing the user interface.
To run the Database tool, follow these steps:
- Make sure that the UCMDB Server is down.
- Run the following batch file from the command line: C:\UCMDB\UCMDBServer\tools\dbscripts\newDbTool.bat
- At the prompt, run the required command.
The Database tool operates in the following modes.
The Consistency mode of the tool enables you to check the consistency of the database. Run the command newDbTool.bat consistency. You can add --showsql at the end of the command to display the SQL commands that are running.
The Deletion mode of the tool enables you to delete CIs and relationships from the database via one of the following methods:
Running the Aging mechanism. Use the command newDbTool.bat aging.When you run the Aging mechanism, CIs and relationships that are candidates for deletion are removed.
Deleting selected CIs by type. You can delete all CIs of a specific type by running the command newDbTool.bat type type_1, type_2 where type_1 and type_2 represent the CI types to delete.
Deleting selected CIs by SQL query. You can delete the CIs selected by running an SQL query. Run the command newDbTool.bat sql <query_name> where <query_name> is the name of the SQL query you have defined.
The following is an example of an SQL query that returns all node CIs with a display label starting with vm:
select CMDB_ID from cdm_node_1 where a_display_label like 'VM%'
The Preview mode of the tool enables you to preview the changes that the consistency mode will introduce before executing them. Run the command newDbTool.bat consistency --preview.