SQL Server数据库实时复制

时间:2022-04-16 03:54:28

I have a database on an SQL Server instance hosted on Azure Windows VM. There are two things I need to achieve.

我在Azure Windows VM上的SQL服务器实例上有一个数据库。我需要做两件事。

  1. Create a real-time duplicate of the database on another server. i.e. I need my database to make a copy of itself and then copy all of it's data to the duplicate at regular intervals. Let's say, 2 hours.

    在另一台服务器上创建数据库的实时副本。也就是说,我需要我的数据库复制自己,然后每隔一段时间将所有数据复制到副本中。比方说,2小时。

  2. If my original database fails due to some reason, I need it to redirect all read/write requests to the duplicate database.

    如果我的原始数据库由于某种原因失败,我需要它将所有读/写请求重定向到复制的数据库。

Any elaborate answer or links to any articles you deem helpful are welcome. Thank you!

任何详尽的答案或链接到任何你认为有用的文章都是受欢迎的。谢谢你!

1 个解决方案

#1


3  

You can have a high availability solution for your SQL Server databases in Azure using AlwaysOn Availability Groups or database mirroring.

可以使用AlwaysOn可用性组或数据库镜像为Azure中的SQL服务器数据库提供高可用性解决方案。

SQL Server数据库实时复制

Basically, you need 3 nodes for true HA. The third one can be a simple file server that will work as the witness to complete the quorum for your failover cluster. Primary and Secondary will be synchronized and in case of a failure, secondary will take over. You can also configure read requests to be split among instances.

基本上,真正的HA需要3个节点。第三个可以是一个简单的文件服务器,它可以作为完成故障转移集群的quorum的见证。初级和二级将同步,如果出现故障,次级将接管。您还可以将读请求配置为在实例之间进行分割。

If HA is not really that important for your use case, disaster recovery will be a cheaper solution. Check the article below for more info.

如果HA对您的用例不是那么重要,那么灾难恢复将是一个更便宜的解决方案。查看下面的文章获得更多信息。

High Availability and Disaster Recovery for SQL Server in Azure Virtual Machines

Azure虚拟机中SQL服务器的高可用性和灾难恢复

https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-sql-server-high-availability-and-disaster-recovery-solutions/

https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-sql-server-high-availability-and-disaster-recovery-solutions/

#1


3  

You can have a high availability solution for your SQL Server databases in Azure using AlwaysOn Availability Groups or database mirroring.

可以使用AlwaysOn可用性组或数据库镜像为Azure中的SQL服务器数据库提供高可用性解决方案。

SQL Server数据库实时复制

Basically, you need 3 nodes for true HA. The third one can be a simple file server that will work as the witness to complete the quorum for your failover cluster. Primary and Secondary will be synchronized and in case of a failure, secondary will take over. You can also configure read requests to be split among instances.

基本上,真正的HA需要3个节点。第三个可以是一个简单的文件服务器,它可以作为完成故障转移集群的quorum的见证。初级和二级将同步,如果出现故障,次级将接管。您还可以将读请求配置为在实例之间进行分割。

If HA is not really that important for your use case, disaster recovery will be a cheaper solution. Check the article below for more info.

如果HA对您的用例不是那么重要,那么灾难恢复将是一个更便宜的解决方案。查看下面的文章获得更多信息。

High Availability and Disaster Recovery for SQL Server in Azure Virtual Machines

Azure虚拟机中SQL服务器的高可用性和灾难恢复

https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-sql-server-high-availability-and-disaster-recovery-solutions/

https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-sql-server-high-availability-and-disaster-recovery-solutions/