views:

437

answers:

1

I'm trying to determine if there's a better way to handle replication than the way we're currently doing things.

We're essentially trying to determine 2 things:

  1. Is there any way to add an existing column from a table to replication without reinitializing the whole publication
  2. Can you just select a specific article to reinitialize instead of all of the articles in a publication?

(I'm a bit new to replication... trying to get up to speed, so I apologize if my terminology doesn't make sense)

Right now we have about 30 publications so that if any have to be reinitialized there's a minimal impact... because several of our tables are pretty massive. We'd prefer to only have several publication.

Any ideas would be greatly appreciated.

Update

When we try to add a column to an article we receive the message:

You have changed one or more properties that require all subscriptions to be reinitialized. Saving these changes marks each subscription that supports automatic reinitialization to be reinitialized from a snapshot the next time its Distribution Agent runs. You must run the Snapshot Agent to generate the snapshot.

We want to avoid reinitializing all subscriptions.. we're using transactional replication... again we want to add an existing column to an existing publication without having to reinitialize all subscriptions.

+2  A: 

What kind of replication? Snapshot, Merge, Transacitonal, Peer-to-Peer?

1) Yes. See Making Schema Changes on Publication Databases:

  • To add a new column to a table and include that column in an existing publication, execute ALTER TABLE ADD . By default, the column is then replicated to all Subscribers. The column must allow NULL values or include a default constraint.
  • To include an existing column in an existing publication, use sp_articlecolumn (Transact-SQL), sp_mergearticlecolumn (Transact-SQL), or the Publication Properties - dialog box.

2) It depends on the replication type. See Reinitializing a Subscription:

Reinitializing a subscription involves applying a new snapshot of one or more articles to one or more Subscribers: transactional and snapshot replication allow individual articles to be reinitialized; merge replication requires all articles to be reinitialized.

Remus Rusanu
According to this http://msdn.microsoft.com/en-us/library/ms152745.aspx both sp_articlecolumn and sp_mergearticlecolumn require a new snapshot and to reinitialize subscriptions.
Chris Klepeis
We're using transactional
Chris Klepeis
In the link you provided the comments about sp_articlecolumn and sp_mergearticlecolumn refer to modifying filters, not schema changes. According to http://msdn.microsoft.com/en-us/library/ms151870.aspx the schema changes are propagated incrementaly w/o the need to re-initialize. You should test and validate.
Remus Rusanu
Schema changes have worked for us, however the issue I'm tyring to test right now is taking an existing publisher, an existing published article and adding an existing column to that article. I have tested it through the wizard and monitored the status of the snapshot and distributor to subscriber history. What I would have hoped for is for it to only generate a snapshot for the article in the publication being modified, but what I'm seeing in the details is that it regenerated the snapshot for every article in the publication and pushed it through distribution.
Chris Klepeis
So I'm wondering if this can be done or not... I've done some replication hacks in my day but have never found a good solution to this problem. Best I've been able to do to-date is to limit the amount of articles in a publication so that if I have to reinitialize it's limited to that group. Doing that just makes things a little messy to work with since I end up with 30 - 40 publications which creates a lot of jobs and numerous system processes.
Chris Klepeis
I rather not venture any deeper in answering on replication topic, sinc eI'm not an expert. You may try http://kendalvandyke.blogspot.com/ , he is trully a replication expert.
Remus Rusanu