Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Replication- distribution server crashed Expand / Collapse
Author
Message
Posted Friday, November 22, 2013 5:40 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Yesterday @ 11:40 PM
Points: 117, Visits: 715
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?
Post #1516974
Posted Monday, November 25, 2013 4:55 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 2:08 AM
Points: 1,350, Visits: 15,200
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.
Post #1517199
Posted Monday, November 25, 2013 6:43 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Yesterday @ 11:40 PM
Points: 117, Visits: 715
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.
Post #1517228
Posted Monday, November 25, 2013 6:58 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 2:08 AM
Points: 1,350, Visits: 15,200
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
Post #1517236
Posted Monday, November 25, 2013 7:02 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 2:08 AM
Points: 1,350, Visits: 15,200
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.
Post #1517238
Posted Monday, November 25, 2013 7:40 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 2:08 AM
Points: 1,350, Visits: 15,200
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.
Post #1517257
Posted Monday, November 25, 2013 10:52 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Yesterday @ 11:40 PM
Points: 117, Visits: 715
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 ?
Post #1517375
Posted Tuesday, November 26, 2013 2:01 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 2:08 AM
Points: 1,350, Visits: 15,200
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.
Post #1517567
Posted Tuesday, December 10, 2013 10:20 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Yesterday @ 11:40 PM
Points: 117, Visits: 715
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??
Post #1521594
Posted Wednesday, December 11, 2013 3:17 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 2:08 AM
Points: 1,350, Visits: 15,200
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.

Post #1521792
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse