Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Reinitialize subscription remove index from subscriber?


Reinitialize subscription remove index from subscriber?

Author
Message
matt.osullivan
matt.osullivan
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 80
We reinitialized the subscription for a replication and noticed afterwards that an index the was created on the subscriber database was missing. This index isn't replicated from the publisher. Is this correct that an index created on a subscriber database will be removed when reinitialized?

Thanks.
DBA_Dom
DBA_Dom
Mr or Mrs. 500
Mr or Mrs. 500 (580 reputation)Mr or Mrs. 500 (580 reputation)Mr or Mrs. 500 (580 reputation)Mr or Mrs. 500 (580 reputation)Mr or Mrs. 500 (580 reputation)Mr or Mrs. 500 (580 reputation)Mr or Mrs. 500 (580 reputation)Mr or Mrs. 500 (580 reputation)

Group: General Forum Members
Points: 580 Visits: 81110
That depends on a few settings. By deafult yes. When you reintialize a subscription it says I need a new fresh copy from a snapshot. Now it depends on how your publication is set to deliever that snapshot. There is a setting for each article for 'Action if name is in use'. This by default will drop and recreate the object. That will remove the index and all other contraints and objects asscoiated with that table (i.e. statistics,Foriegn Keys, triggers). If these objects are not part of the source table and in the setting for the article to be copied over then they will no longer exist at the source.

There are various ways to continue to have an index on a target table and not on the source. This just depends on what your enviroment is like.
David Benoit
David Benoit
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2108 Visits: 3650
If you look under the publication properties, Articles, select the article / table in question and look at the properties of that article you should be able to set "Copy nonclustered indexes" to True and then non-clustered indexes will be copied as part of the snapshot process. That said, if you add an index on the publisher, that will NOT replicate that to the subscriber. That will need to be done manually.

You can also use sp_changearticle to set the schema_option to allow for the copy of nonclustered indexes as part of the snapshot but that is a bit more complex and I would recommend staying in the GUI for this one.

Hope this helps.

David

@SQLTentmaker

“He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot
matt.osullivan
matt.osullivan
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 80
Thanks for the replies, you have both been very helpful!
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