Now it gets a little bit tricky, because how will you handle databasemirroring and replication together?
Letâ€™s imagine a scenario, where we want to replicate a table from a mirrored database to another database. If we failover, then replication should continue to work. Is that possible?
Yes, and it is fairly easy to setup, what you need to do is:
- Setup the mirroring.
- Setup a distributor and publication on the current principal server(think about having the distributor on its own server).
- On the mirrorserver setup distribution and use the same distributor as on the current principal server.
- Add both the distributor and mirrorserver to the replication monitor.
- Set â€“PublisherFailoverPartner property for the agents (in my demo it will be the snapshotagent and the log reader agent.