Clean Up Scripts for BizTalk

Since I always have a hard time remembering where it is and what to run, there are two scripts that you can run in your non-production region that can clean up currently running orchestrations that you have already terminated and it is waiting to clear it up.

You will first need to go and create the real stored procedure bts_CleanupMsgBox (this replaces the shell that is there). This file is located in the ..\BizTalk Server 200X\Schema\msgbox_cleanup_logic.sql. (I know that this was an add-on in 2004 SP1, but the stored proc needs to be loaded within 2006 also)

There is a new stored proc that can be obtained by calling support and referencing this article.

The instructions are as follows to clean it up:

  1. Stop BTS.
  2. Do IISRESET if you are using web services.
  3. Run "bts_CleanupMsgbox" on your message box database. This will mark your instances for deletion and it will not actually delete it.
  4. Run "bts_PurgeSubscriptions" on your message box database. This will purge all your messages marked for deletion.
  5. Restart your BTS.

If you want to completely purge the DTADb there is a nice little stored proc that takes it time to run, but it gives you a completely clean database:

  1. Stop BTS
  2. Run "dtasp_CleanHMData" on the DTADb
  3. Restart your BTS

posted @ Tuesday, November 14, 2006 12:00 PM

Print

Comments on this entry:

 re: Clean Up Scripts for BizTalk

Left by prasoon at 1/31/2007 9:49 PM
Gravatar

hi Eric,
i found your blog very usefull to me but when try to search the "\BizTalk Server 200X\Schema\msgbox_cleanup_logic.sql." file it was not there in the folder, i am using BT 2004. Anyhow, i found the bts_CleanupMsgBox stored procedure in msgboxlogic.sql file but no logic is given in that it is a blank stored procedure given below:
CREATE PROCEDURE [dbo].[bts_CleanupMsgbox]
@fLeaveActSubs int = 1
AS

GO

will i have to write the logic in that if yes please give the logic too.
please advice me ASAP....
thanks
Prasoon

# re: Clean Up Scripts for BizTalk

Left by Eric at 1/31/2007 10:48 PM
Gravatar

If memory serves me correct, this is installed as part of BTS SP1.

 re: Clean Up Scripts for BizTalk

Left by Prasoon at 2/1/2007 8:32 PM
Gravatar

BTS SP1 is already installed on my system but i am still not getting the sp. but SP-2 is not installed.
shloud i install the BTS SP-1 again?
thanks
prasoon

# re: Clean Up Scripts for BizTalk

Left by Eric at 2/1/2007 8:41 PM
Gravatar

If you go into the schema directory in BizTalk, you need to install it first from there, and then execute it. I don't think that I mentioned that.

# re: Clean Up Scripts for BizTalk

Left by Dan at 3/4/2007 3:27 PM
Gravatar

Thanks for that tip, Eric! It worked great - I had some "active" isolated host instances that would not go away no matter what. This cleared it up.

 re: Clean Up Scripts for BizTalk

Left by Mike at 9/6/2007 11:19 AM
Gravatar

Thanks _so__ much, that worked perfectly.

 re: Clean Up Scripts for BizTalk

Left by Roland at 12/1/2009 9:14 AM

Eric for president!
(at leat in BizTalk country)

Your comment:



 (will not be displayed)


 
 
 
Please add 1 and 3 and type the answer here:
 

Live Comment Preview:

 
«March»
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910