One maintenance task that I often perform when finishing development on a client is to refresh my BizTalk environment. This usually includes cleaning up the tracking and MessageBox databases of old tracking data and messages. The BizTalk 2010/2013 installation includes a set of stored procedures that can assist in this effort and ensure a BizTalk environment.
One word of warning, the following should not be performed on a production environment.
- The first step is to stop all BizTalk Host Instances and stop IIS.
Create the ‘bts_CleanupMsgbox’ stored procedure by executing the <BizTalk Installation>\Schema\msgbox_cleanup_logic.sql on the BizTalkMsgBoxDb.
- After the creation of the stored procedure run the following SQL query:
- Then execute the bts_PurgeSubscriptions stored procedure using the following query:
- The dtasp_CleanHMData stored procedure within the BizTalkDTADb database will clean up the tracking database. Execute the following query against the BizTalkDTADb:
- Start all BizTalk Host Instances and start IIS.
More information can be found on MSDN