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

Strange transactional replication problem Expand / Collapse
Author
Message
Posted Thursday, November 1, 2012 4:03 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, March 13, 2013 9:40 PM
Points: 12, Visits: 171
I have two SQL databases P and S.
I created backup of P and restore the backup at S.
Then I created a pull subscription from S to P without initialization (from http://msdn.microsoft.com/en-us/library/ms151246%28v=sql.105%29.aspx) by clearing the Initialize check box on the Initialize Subscriptions page of the New Subscription Wizard.
That seems to work, and I can see that newly added rows to tables in P are replicated to S.

The problem arises when I tried to add a new article in P (with the option "Truncate existing data if object exist").
I cannot get the new article to replicate to S.
I have tried to run the snapshot agent in S to create a new snapshot, but it does not help.
Newly added rows to the added article are not replicated to S.

I don't know what's wrong here. I tried to repeat the steps with initialization (i.e. tick the "Initialize" check box on the New Subscription Wizard), then newly added article is successfully replicated.

Any ideas?
Post #1379710
Posted Thursday, November 1, 2012 4:59 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 8:56 PM
Points: 3,033, Visits: 2,636
You need to add the new article to the existing subscription (or create a new subscription if you prefer). Just creating a new article in an existing publication will not result in the article being replicated to an existing subscriber. Once the article is included in a subscription, a snapshot will be delivered (subject to how you created the subscription) to the subscriber.


Post #1380088
Posted Thursday, November 1, 2012 7:45 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, March 13, 2013 9:40 PM
Points: 12, Visits: 171
How to add the new article to the existing subscription?
I am using pull subscriptions, I tried to run sp_refreshsubscriptions at the publisher, but it does not help.
Running the snapshot agent results in "A snapshot was not generated because no subscriptions needed initialization".
Post #1380106
Posted Thursday, November 1, 2012 8:03 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, March 13, 2013 9:40 PM
Points: 12, Visits: 171
Found my situation is exactly the same as described here: http://www.sqlservercentral.com/Forums/Topic348837-291-1.aspx


This one is driving me crazy...

We are using Transactional Replication with the subscribers initialized from a backup (no snapshot). It's working great, but now we need to add several new articles to the publication and have them picked up in the subscribers.

The only way I can get this to work is to drop the subscriber, backup the published database, restore the previously made backup over the destination databases and then re-create the subscriptions. There has to be a better way?

I've tried using the sp_reinitializesubscription, but that doesn't work since we aren't using a snapshot. I've tried skipping the restore, and just creating the tables in both the source and destination databases. Doing this, the subscription is re-created sucessfully, but data in the new articles is not actually being replicated.

Replication isn't my forte, and the documentation on initializing with backups is pretty sparse, so any advice is appreciated.

Post #1380109
Posted Sunday, November 4, 2012 4:14 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 8:56 PM
Points: 3,033, Visits: 2,636
Your issue may be the same but the resolution is potentially not the best. You should be able to add the new article to the existing publication.

Unfortunately, I am at home and can't test this but you should be able to use sp_addarticle to include the new table/article in your publication. Once this is done, the run snapshot agent and the distribution agent should sort out the rest.



Post #1380781
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse