Monday, August 11, 2014

Reset BizTalk Server MsgBox Database – for all Developers

Did you find your Development Machine performing slowly, its time to clean up the Message Box and Tracking Data..
** This should be executed on the development/test machine only. Executing this in Production will lead to loss of data **
Here are few steps to clean up BizTalk Message Box Database.
1. There is a Stored Proc bts_CleanupMsgbox in BizTalkMsgBoxDb Database. By default this stored proc does nothing. It’s Dummy. This is to prevent accidental execution in the Production Server.
2. Execute a script to recreate bts_CleanupMsgbox. Script can be found at <BizTalk Dir>\Schema\msgbox_cleanup_logic.sql. This script should be executed in BizTalkMsgBoxDb Database.
3. Stop BizTalk services from the Services (Start -> Run -> Services.msc).
4. Reset IIS server incase if you have any running isolated host instances
5. Execute stored procedure bts_CleanupMsgbox on your message box database
This SP will take an input parameter @fLeaveActSubs.

Values for this should be ‘0’ or ‘1’. ‘1’ is the default in case if you don't supply a value.

Setting the value to ‘0’ results in clearing the active subscriptions and you may have to redeploy the application. Think twice before doing this.
The above will not clear off all the subscription but will mark for deletion .
6. Execute the stored procedure bts_PurgeSubscriptions on your message box database to purge them all.
7. Start BizTalk services
To clean up the Tracking data in BizTalkDTADb Database:
1. Stop BizTalk services from the Services (Start -> Run -> Services.msc).
2. Execute stored procedure dtasp_CleanHMData on BizTalkDTADb database.
3. Start the BizTalk services
Post a Comment