UCMDB Support Tip: How to use dbtool
dbtool.bat file is located at following location …\\hp\UCMDB\UCMDBServer\tools\dbscripts
Its purpose - The dbtool.bat also known as dbtool, can be used in the following cases (Please note it needs to be run from command prompt. It is recommended to keep a copy of console text after dbtool finishes execution):
1. Consistency: Delete obsolete rows from db (that cause error “Primary key constraint error” in mam-autodiscovery log) Syntax: dbtool.bat consistency
2. Aging: Delete aged CIs (that aging might take longer time to remove CI depending on the amount of CIs. Its important to reviews point 1,2,3 and 4 below in important notes) Syntax: dbtool.bat aging
3. Delete CI by CIT: Delete CIs by classtype. Syntax: dbtool.bat type software (the above command will delete all CIs of type “installed software”)
- Please review the readme.txt enclosed with the dbtool_consistency.zip attached below. It contain deployment information (UCMDB prior to 8.04 only)
- Running the tool requires complete UCMDB/BAC server shutdown.
- Before running the tool, a CMDB database backup should be performed
- In Aging or Delete CI by CIT mode - the tool deletes aged CIs and relationships without recording the deletion event in CMDB History.
- It is highly recommended to run the tool in the testing environment against a copy of the real CMDB database first, before applying it in production
- This tool supports Oracle and SQL Server 2005 databases.
- Most information related to execution of dbtool is logged in dbtool.log, this log file is present under log folder of the respective UCMDB/BAC machine.
- dbtool can be run in DEBUG mode to provide additional DEBUG information in dbtool.log. DEBUG can be enabled on dbtool logging by modifying dbtool.properties as shown below. The dbtool.properties can be located under directory <BSM/UCMDB install>\conf\core\tools\log4j\PlainJava\ Find following two lines in dbtool.properties log4j.category.cmdb.db.tool=INFO, dbtool, stdout##log4j.category.com.mercury=DEBUG, debug_appender
Modify the above line so they look like follows to enable DEBUG on dbtool.log##log4j.category.cmdb.db.tool=INFO, dbtool, stdout log4j.category.com.mercury=DEBUG, debug_appender
Note: When using windows authentication to connect to the MS SQL DB, the dbtool needs to be run with the appropriate user i.e. right click on the dbtool batch file, choose "Run as" and then choose the relevant user. The reason is that when running against MSSQL DB, dbtool does not specify a specific database. It assumes that the database the user has access to is the UCMDB database. When using Windows credentials to access MSSQL there is a possibility that the login user is not the UCMDB user. Thus, the dbtool will run against whatever DB that the login user has access. This creates tables in the wrong DB and causes dbtool to throw errors later on.
If you find this or any post resolves your issue, please be sure to mark it as an accepted solution."
Click the KUDOS star on the left to say 'Thanks'
Re: UCMDB Support Tip: How to use dbtool
when running NEWdbtool gainst 10.10 database on SQL Server 2008, using database crfedentials, not NTLM authentication, I get errors about the user not having permissions to "perform this action" - which action is not specified.
The database user is the same one that uCMDB runs with. So, what additional permissions does the user need above th ones necessary to run uCMDB ?
The user has db_owner role