BizTalk Server installs a total of 13 SQL Server Agent jobs.
Experienced BizTalk administrators know that almost all of these jobs must remain enabled and run successfully. The only exception is the MessageBox_Message_Cleanup_BizTalkMsgBoxDb job.
In other words, apart from that job, you should not disable the remaining BizTalk SQL Agent jobs during normal operation.
📝 One-Minute Brief
This post provides SQL scripts to quickly enable or disable all BizTalk Server SQL Server Agent jobs. It explains why administrators must disable these jobs before maintenance or recovery actions (such as running the BizTalk Terminator tool), instead of manually stopping each job individually.
Why Disable the Jobs?
One of the most important tools used to resolve serious BizTalk Server problems is the BizTalk Terminator tool. Terminator provides the easiest way to fix many issues detected by the Monitor BizTalk Server Job.
However, before running the Terminator tool, you must always ensure that:
- You created a full BizTalk database backup.
- All BizTalk host instances are stopped.
- All BizTalk SQL Server Agent jobs are disabled.
Unfortunately, SQL Server Management Studio does not provide a quick way to enable or disable all jobs at once. Therefore, administrators must normally disable them one by one, which is slow and error-prone.
This query will disable all the BizTalk SQL Server Agent jobs (including the MessageBox_Message_Cleanup_BizTalkMsgBoxDb):
update msdb.dbo.sysjobs set [enabled] = 0 where [name] = 'Backup BizTalk Server (BizTalkMgmtDb)'
update msdb.dbo.sysjobs set [enabled] = 0 where [name] = 'CleanupBTFExpiredEntriesJob_BizTalkMgmtDb'
update msdb.dbo.sysjobs set [enabled] = 0 where [name] = 'DTA Purge and Archive (BizTalkDTADb)'
...
update msdb.dbo.sysjobs set [enabled] = 0 where [name] = 'TrackedMessages_Copy_BizTalkMsgBoxDb'
update msdb.dbo.sysjobs set [enabled] = 0 where [name] = 'MessageBox_Message_Cleanup_BizTalkMsgBoxDb'
After all these tasks are complete, we need, of course, to enable and start everything. This query will enable all the BizTalk SQL Server Agent jobs (with the exception of MessageBox_Message_Cleanup_BizTalkMsgBoxDb):
update msdb.dbo.sysjobs set [enabled] = 1 where [name] = 'Backup BizTalk Server (BizTalkMgmtDb)'
update msdb.dbo.sysjobs set [enabled] = 1 where [name] = 'CleanupBTFExpiredEntriesJob_BizTalkMgmtDb'
update msdb.dbo.sysjobs set [enabled] = 1 where [name] = 'DTA Purge and Archive (BizTalkDTADb)'
...
update msdb.dbo.sysjobs set [enabled] = 1 where [name] = 'TrackedMessages_Copy_BizTalkMsgBoxDb'
Download
THESE SQL SCRIPTS ARE PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.
You can download the SQL Query to Enable All BizTalk SQL Server Agent jobs from GitHub here:
You can download the SQL Query to Disable All BizTalk SQL Server Agent jobs from GitHub here:
Hope you find this helpful! If you liked the content or found it useful and would like to support me in writing more, consider buying (or helping to buy) a Star Wars Lego set for my son.
