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
  1. use distribution
  2. go
  3. 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.
  1. use distribution
  2. go
  3. if exists (select * from distribution..MSsubscriptions where status = 0)
  4. begin
  5.     UPDATE distribution..MSsubscriptions
  6.     SET STATUS = 2
  7.     WHERE publisher_id = 0
  8.     AND publisher_db = 'Publisher_Db'
  9.     AND publication_id = 16
  10.     AND subscriber_id = 0
  11.     AND subscriber_db ='Subscriber_Db'
  12. end
  13. else
  14. begin
  15. print 'All the subscription is Active'
  16. end
4. Check the replication monitor for any issues.

2 comments: