Hi,
Here is the situation. We have existing replication with sql 2008 r2 publisher and a subscriber on same edition. The database is quite big so snapshot generally takes about 4 hours or more. There are additional tables on subscriber so a backup / restore mode of initialization is not suitable.
This replication is working just fine, now there is a need to add a sql 2014 subscriber to this publisher and same tables as in current publication, so we decided to simply add another push subscription for this new sql 2014 subscriber. During the process the Initial snapshot is generated and applied to new 2014 subscribe, keep in mind we have not made any change to publication to avoid affecting the existing subscriber. So when snapshot is delivered and appeared in replication monitor it started creating primary keys on subscriber database. We have few big tables where we are not sending clustered and non clustered indexes across so that replication snapshot goes fast (although it is over 4 hours). These indexes and primary keys get created with manual scripts after snapshot is generated. During this time log reader agent has been actively sending transactions to existing subscriber that is telling me that as soon as distribution agent done with the snapshot it will start sending transactions to new subscriber (which is quite normal). Now the problem, after snapshot is done I need to run manual scripts to create PK and indexes on new subscriber, to do that I have to stop distribution agent so that indexes and PKs don't get blocked. After I stopped distrib agent temporarily, the Scripts got completed successfully within 20 minutes and when I re-started distribution agent , to my surprise it started initializing the new subscriber again and sending same snapshot that was already applied. It make me puzzled what caused the distribution agent to reinitialize although it already delivered snapshot and I have indexes created and ready to go. I tried this process again with more careful approach and gave about one hour after snapshot delivered message received. but it did the same thing. Only explanation I can think of that publisher database is actively sending transactions when I was applying snapshot and as soon as it is delivered, the distribution agent started delivering transaction, I could see Undistributed Commands kept on growing high telling me that there are lots of transactions for new subscriber to catch up but without indexes and some missing primary keys it would not even catch up and so I always stop the distrib agent and run my scripts on subscriber and run into this situation. During all these times the existing subscriber never had any issue.
Do I need to make sure no ort minimal transactions happening on publisher when I initialize the new subscriber.
Or should I create new separate publication on the same publisher and use that.
Any other suggestions are welcome
Thanks!
dba60