The TMCM database size still remains huge even after purging the other logs and optimizing the database.
Control Manager (TMCM) also stores Command Tracking logs which cannot be purged via the console. This leads to a substantial growth in the database size.
To purge the Command Tracking logs:
- Open the SQL Query.
- Stop the TMCM Services.
- Run the following scripts in SQL query: If the TMCM server is a Child server in a cascading environment, and is scheduled to perform Upload Logs at a certain schedule, the logs being uploaded to the Parent CM server will be lost if the tb_templog is truncated.
truncate table tb_tvcscommandlist;
truncate table tb_tvcsCommandTaskqueue;
truncate table tb_commanditemtracking;
truncate table tb_commandtracking;
Backup log db_controlmanager with truncate_only;
exec sp_dboption 'db_controlmanager', 'trunc. log on chkpt.', 'TRUE';
exec sp_dboption 'db_controlmanager', 'autoshrink', 'TRUE';
- Restart the TMCM Services.
You can also change the automatic purge settings for the Command Tracking logs (90 days for CommandTracking and 24 hours for CommandTaskQueue) in the SystemConfiguration.xml file:
- CommandItemTracking and commandTracking are configured in "m_iCommandTrackingLogPurgeRange".
- CommandTaskQueue table is configured in "m_iCommandQueueTimeOut".
Restart the TMCM services after changing the settings in the XML file.