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


Strange transactional replication problem


Strange transactional replication problem

Author
Message
alanlee
alanlee
SSC Rookie
SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)

Group: General Forum Members
Points: 40 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?
happycat59
happycat59
SSCarpal Tunnel
SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)

Group: General Forum Members
Points: 4746 Visits: 3218
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.



alanlee
alanlee
SSC Rookie
SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)

Group: General Forum Members
Points: 40 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".
alanlee
alanlee
SSC Rookie
SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)

Group: General Forum Members
Points: 40 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.

happycat59
happycat59
SSCarpal Tunnel
SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)

Group: General Forum Members
Points: 4746 Visits: 3218
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.



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