Error in replication::subscription(s) have been marked inactive and must be reinitialized

I don't think this will be new to most people, but it's something that I came across recently and spent some time researching. The scenario here is that our customer has a business administration system in their office that is used to manage, among other things, details of their customers. They have a website that allows customers to log in and change some details. The website is hosted with an ISP and the administration system is kept in house. They are both use SQL Server 2000 databases. To keep the two databases in sync, two-way transactional replication is used.

We had some teething problems with this when it was first setup, but since then it has worked reliably, until recently. They had an ADSL outage to their office that lasted for a number of days (I think it started on a Thursday evening and was not resolved until the following Monday morning). When the problem was finally solved our customer noticed that replication was no longer working. The following error message was being presented on both ends:

Error in replication::subscription(s) have been marked inactive and must be reinitialized

We could have reinitialized as the error message suggests, but this was not desirable due to the volume of data involved – we would have been forced to re-sync the entire database which is several gig in size. The usual restarts and reboots did not solve the problem.

We knew that there was no problem with the data, all of the changes were queues in the transactions to replicate table, it’s just that replication wasn’t happening. I did some research on the subject and discovered that there is a status column in the MSsubscriptions table in the distribution database that indicates the status of each subscription. 0 = Inactive, 1 = Subscribed, 2 = Active. I also read that it is safe to update this status; it just puts SQL Server back in the state that it was in before the subscription status was changed. Depending on what the initial problem, this may not be what you want, but in this case, it is exactly what I wanted to do.

“Select * from distribution..MSsubscriptions” confirmed that this was correct

“update distribution..MSsubscriptions set status=2” run against both database instances solved this problem.

Why this hasn’t been build into the SQL Server I don’t know, but maybe it’s because it can be dangerious to do this if you don’t understand what you are doing and why.