Quantcast
Channel: SQL Server Replication forum
Viewing all articles
Browse latest Browse all 4054

Enable Replication/CDC from High Availability Group

$
0
0

Hello Experts,

First of all, I should confess that I have very minimal knowledge about both HA and Replication. So, pardon me if I am posting in the wrong forum and feel free to move it to the respective forum.

I would need your expertise in setting up few things.

I have a HA Group where our Application is sitting or communicating with the Databases. Obviously this group will have a Primary node and a Secondary node based on the definition of High Availability Group. The Application could be reading/writing data to the database either through a Listener/Load Balancer.

So, now my requirement is, I would like to setup Replication from the HA Group to a Staging Database server so that I can enable CDC on my Staging Database Server. I know that CDC can be enabled on HA Group itself but, due to some organization policies, I would like to enable CDC ONLY on Staging Database Server.

As part of this, I would like to script out all the Replication scripts from the Publisher (HA Server) to Subscriber (Staging DB Server). Could someone please help me with scripts as most of the internet talks about doing it through SSMS? The reason I would like to script out this is because, every time the Application does a build, I would like them to disable the Replication, do their build, and then re-enable the Replication at the end. It was also my understanding that, in order to enable/disable Replication one should have sysadmin privileges. If that is the case, can I setup a SQL Agent Job and allow the application to run the Job to enable/disable Replication whenever they're doing the build? Please advise.

Thanks!

 

Known is a DROP, Unknown is an OCEAN.


Viewing all articles
Browse latest Browse all 4054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>