In some ocassions, you may run into a runaway, long-running or stucked staging batch with Master Data Services in SQL Server 2008 R2. The issue happens most frequently when a fairly large batch of rows are being processed for update or deletion.
The issue has to do with Service Broker, either due to a timeout or notifications not being received or received incomplete. You can confirm the issue when you query the queue [mdm].[microsoft/mdm/queue/stagingbatch]. You will see one or more messages in this queue. After searching through a couple of forum threads I found the solution to be fairly simple: rollback transactions an re-enable Service Broker. The steps are as follows:
- Set the MDS database in single user mode and rollback uncommitted transactions.
ALTER DATABASE [MDS] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
- Re-enable Service Broker on the MDS database.
ALTER DATABASE [MDS] SET ENABLE_BROKER WITH NO_WAIT;
- Set the MDS database back in to “regular” multi-user mode.
ALTER DATABASE [MDS] SET MULTI_USER WITH ROLLBACK IMMEDIATE;
Once the MDS database is brought back online, all queued messages should be cleared out and MDS database will be able to communicate normally with Service Broker.
You can check Books on Line for more information on the difference between “NO WAIT” and “WITH ROLLBACK IMMEDIATE” options when issuing the ALTER DATABASE command here. Pinal Dave has a good post about the difference between these two options as well here.
Hope this post has helped you. Your feedback is greatly appreciated.