简体   繁体   English

通过VPN进行SQL Server事务复制

[英]SQL Server Transactional Replication Over VPN

I have transactional replication running between two servers over a dedicated VPN connection. 我通过专用VPN连接在两台服务器之间运行事务复制。 The databases are fairly large, so I initially use the backup and restore method to get the initial snapshot over to the subscriber machine and then let it apply the incremental transactions from there. 数据库相当大,所以我最初使用备份和还原方法将初始快照传送到订阅者计算机,然后让它从那里应用增量事务。

Everything runs fine until the VPN line gets flaky (which it does occassionally) at which point the replication process is prone to locking up. 一切运行良好,直到VPN线路变得不稳定(它偶尔会发生),此时复制过程很容易锁定。 When I look on the subscriber side, there are a few SQL processes which appear to be hung and have locks held on the subscriber database and tables. 当我查看订阅者端时,有一些SQL进程似乎挂起并且在订阅者数据库和表上保持锁定。 The crazy thing is that those processes are coming from the replication service. 疯狂的是这些进程来自复制服务。 I can assure you (from trial and error) that no other processes are locking this database except for replication itself. 我可以向您保证(从试验和错误)除了复制本身之外没有其他进程锁定此数据库。

So why would the replication process trip over its own feet like that? 那么为什么复制过程会像这样绊倒自己的脚呢? Why would it get hung just because of a loss of network connectivity? 为什么会因为网络连接丢失而挂起? Any suggestions for somehow making it more reliable? 有什么建议让它更可靠吗?

I have heard of issues like this over vpn connections. 我在vpn连接上听说过这样的问题。 There is a post here that might help you. 有一个帖子在这里可以帮助你。

Another option, if you have persistent problems, and depending on your requirements for speed and functionality, might be to use log shipping. 另一个选择,如果您遇到持续性问题,并且根据您对速度和功能的要求,可能会使用日志传送。 In my humble opinion this can provide a more resilient way of moving data - at least from a networking perspective. 在我看来,这可以提供更灵活的数据移动方式 - 至少从网络角度来看。

With SQL Server 2005 they allow you to replicate using a web service. 使用SQL Server 2005,它们允许您使用Web服务进行复制。 This might not allow you to ditch the VPN but since web services are less connection driven that might help fix the problem. 这可能不允许您放弃VPN,但由于Web服务的连接驱动较少,可能有助于解决问题。 I haven't tried this myself so I don't know what the results may be. 我自己没试过,所以我不知道结果会是什么。

As for the locks we've had a scare thinking alot of things were locked but it turned out that the replication monitor was just locking on its self so make sure you don't have that open when looking at the locks. 至于锁,我们有一种恐慌,认为很多东西都被锁定了但事实证明复制监视器只是锁定它自己,所以确保你在查看锁时没有打开它。 That doesn't sound like your problem though. 这听起来不像你的问题。

I'll ask some questions and maybe they can give you some ideas as I don't have a clue here either. 我会问一些问题,也许他们可以给你一些想法,因为我也没有任何线索。

Is there a way for the replicator to test for connectivity before attempting to start copying? 在尝试开始复制之前,复制器是否有办法测试连接? Is there a way to put a connectivity test into whatever script you're using to perform replication? 有没有办法将连接测试放入您用于执行复制的任何脚本中? Is there a way to have the script bail in case of failure? 有没有办法让脚本在失败的情况下保释?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM