July 15, 2015 at 1:09 pm
Hi,
When creating the snapshot I didn't choose the option copy non-clustered indexes. I created some indexes manually on subscriber database. Replication failed later with some issue.
so reinitialized with new snapshot but all the indexes are gone from the subscriber database.
How to keep the indexes without dropping from subscriber database whenever we reinitialized with snapshot
July 15, 2015 at 2:04 pm
I believe when you initialize from a snapshot by default it will drop and create the tables, hence the indexes will be gone. If your indexes are the same as what's on the publisher you could simply include them in the options for the article, or if they are custom you could keep them scripted out and then apply as part of the re-initialize. You should also look at the pre-creation options on the article; while I don't have a setup handy to verify I would bet if you change the option from the default of 'drop' to 'truncate' or 'delete' your indexes will remain.
Senior DBA - Gateway Ticketing Systems
Co-Founder - Do It Simply Software
July 15, 2015 at 8:22 pm
If we change that option now, is this required to reinitialize again
July 16, 2015 at 5:18 am
Which option do you mean (the include indexes or the 'truncate' vs 'drop' pre-creation one)?
Senior DBA - Gateway Ticketing Systems
Co-Founder - Do It Simply Software
July 16, 2015 at 5:38 am
Yip, you will be asked to reinitialize if you make any changes to the publisher properties.
You can also look at including a script to run after a reinitialize.
or, change the properties of the articles from "drop and recreate" to "delete"
July 19, 2015 at 5:13 pm
Thank you
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply