Wednesday, July 1, 2015

(Solved) SQL Server Error: The subscription(s) have been marked inactive and must be reinitialized. NoSync subscriptions will need to be dropped and recreated.

Solution:

1. Run the below query to check the status of the subscription
use distribution
go
select * From distribution..MSsubscriptions
2. Note down the publisher_id, publisher_db, publication_id, subscriber_id, subscriber_db if the status is 0

3. Then update the status by runing the below query, apply the where condition value properly that you have noted in the previous step.
use distribution
go
if exists (select * from distribution..MSsubscriptions where status = 0)
begin
    UPDATE distribution..MSsubscriptions
    SET STATUS = 2
    WHERE publisher_id = 0
    AND publisher_db = 'Publisher_Db'
    AND publication_id = 16
    AND subscriber_id = 0
    AND subscriber_db ='Subscriber_Db'
end
 else
begin
 print 'All the subscription is Active'
end
4. Check the replication monitor for any issues.

2 comments: