SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Replication- distribution server crashed


Replication- distribution server crashed

Author
Message
deep_kkumar
deep_kkumar
SSC Veteran
SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)

Group: General Forum Members
Points: 263 Visits: 756
What are the options of setting up the replication without configuring it from the scratch when distribution server is crashed. Is there any way to build up the distribution database if we have the data in sync on both publisher and subscriber?
MysteryJimbo
MysteryJimbo
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2239 Visits: 15346
Are there any distribution db backups? If so there is an MS article on how to restore it.

Will the data have changed on the published databases? If not, you can create a new distributor and rebuild replication. Add the subscribers with a @sync_type of 'replication support only' which will only recreate the subscriber procs but not touch the data or require a snapshot.
deep_kkumar
deep_kkumar
SSC Veteran
SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)

Group: General Forum Members
Points: 263 Visits: 756
MysteryJimbo (11/25/2013)
Are there any distribution db backups? If so there is an MS article on how to restore it.

Will the data have changed on the published databases? If not, you can create a new distributor and rebuild replication. Add the subscribers with a @sync_type of 'replication support only' which will only recreate the subscriber procs but not touch the data or require a snapshot.


We have the latest backup of distribution database. But the data on publisher changes every minute and also as the distributor will not be available, it will be hard for us to clear the orphan publications and subscriptions and the publisher can have only one distribution server. So first we have to clear the publications not to use distributor and remove the publisher from replication.

Can you please provide the link for that MS article ? Thanks.
MysteryJimbo
MysteryJimbo
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2239 Visits: 15346
If you plan on restoring the distribution db on the same distribution server you shouldn't need to cleanup replication on the publisher/subscriber. You would only need to do that if it is a new distributor.

This is the article I was referring to. The strategy is different for merge as data can change at either end.
http://technet.microsoft.com/en-us/library/ms152560(v=sql.105).aspx
MysteryJimbo
MysteryJimbo
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2239 Visits: 15346
deep_kkumar (11/25/2013)

We have the latest backup of distribution database. But the data on publisher changes every minute


If you cannot restore the distribution db, you will have to reintialise from snapshot. You're publisher transaction logs will continue to grow until you recover the distributor as the log cannot be cleared until all replicated commands are committed there. This is good, as it means once recovered, the log reader will know everything that still needs to replicate.

deep_kkumar (11/25/2013)
So first we have to clear the publications not to use distributor and remove the publisher from replication.



If you do this, the above doesn't apply. As soon as replication is removed, the next transaction log backup will go through and clear out all of the commands. You will need to reinitialise the subscriber in some way.
MysteryJimbo
MysteryJimbo
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2239 Visits: 15346
MysteryJimbo (11/25/2013)

This is good, as it means once recovered, the log reader will know everything that still needs to replicate.


I should have been clearer. You continue to stand a risk of that undistributed transactions in the distribution db be lost if they weren't captured in the latest backup. The number of these (if any) depends on how busy the system was at the time of the corruption.
deep_kkumar
deep_kkumar
SSC Veteran
SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)

Group: General Forum Members
Points: 263 Visits: 756
MysteryJimbo (11/25/2013)
MysteryJimbo (11/25/2013)

This is good, as it means once recovered, the log reader will know everything that still needs to replicate.

I should have been clearer. You continue to stand a risk of that undistributed transactions in the distribution db be lost if they weren't captured in the latest backup. The number of these (if any) depends on how busy the system was at the time of the corruption.


Yeah that's a big problem. I guess it's better to reset from scratch by generating the snapshot. Let us assume the distribution server is down and we have to delete the orphan publications so that when we reset it up it will not throw any error saying that it cannot connect to the distribution database as the distribution server is down. This makes the situation more complex as a publisher can have only one distribution database. We have to delete the orphan publications and subscriptions by ignoring the database.

A different scenario, let us assume before doing the maintenance work on distribution server , if we have the latest backups of distribution database and msdb database of distribution server. Can we restore these backups on to a new server(same name as previous distributor server) and kick start the jobs? Does this take care of all the undistributed transactions in the distribution db and the pending transactions on the publisher? Can this be done ? Any suggestions ?
MysteryJimbo
MysteryJimbo
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2239 Visits: 15346
In theory this should work as a two stage process.

Restore the SQL server as the host using master and msdb recovery
Restore the distributor using the distribution db.
deep_kkumar
deep_kkumar
SSC Veteran
SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)SSC Veteran (263 reputation)

Group: General Forum Members
Points: 263 Visits: 756
Jimbo,

I tested it by restoring the master,msdb and distribution databases. But i am facing problems with log reader agent throwing following errors--

The process could not execute 'sp_repldone/sp_replcounters' on 'MyPublisherServer'

The specified LSN (%value) for repldone log scan occurs before the current start of replication in the log

Our production server is a huge OLTP , I cannot run the sp_replrestart and miss the transactions. Is there any work around for this problem??
MysteryJimbo
MysteryJimbo
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2239 Visits: 15346
It looks like published database has had its transaction log restored past what was logged in the distribution db. There is a gap in LSN's preventing the logreader from starting as the log has been cleared of that LSN so it is now in the "future".

Its been a significant amount of time since this issue occurred, I suspect you may have take it on the chin now and consider alternatives. Initially though, you need to get replication up and running on production and that involves loosing those transactions.

You will need a plan on how to synchronise the data on the subscriber in someway.

Perhaps consider setting up a logship from the published db and having a small outage to set up a no-sync subscription. You could logship to a different db name and rename it when you bring it online if you need to keep the subscriber db available (even though its out of sync). This would eliminate the need to generate a snapshot.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search