CE 复制导致 SQL Server 2008 数据丢失
我正在使用 SQL Server 2008 CE 复制,并且似乎遇到了一些数据丢失(即完全同步后记录没有出现在 CE 数据库上)。
我在应用程序日志中收到以下条目:
复制-复制合并子系统:代理 0033007B-0043-0039-4400-440036003300 失败。内部错误:尝试处理同步请求时,设备或 IIS 服务器的读取操作返回了错误的字节数。 [,,,,,]
复制-复制合并子系统:代理 0045007B-0038-0037-3200-430036004200 失败。内部错误:运行 IIS 的计算机内存不足,或者请求中发送了不正确的会话 ID。 [会话 ID,,,,,]
复制-复制合并子系统:代理 0033007B-0043-0039-4400-440036003300 失败。表行计数验证失败。尝试重新同步。 [,,,,,]
复制-复制合并子系统:代理 0043007B-0036-0044-4400-320032003000 失败。合并进程无法初始化订阅。确保发布者处存在订阅注册,并在必要时重新注册订阅。
复制-复制合并子系统:代理 0036007B-0037-0042-4500-370036003600 失败。运行 IIS 的计算机上的身份验证失败。 [,,,,,]
这些消息似乎表明 IIS 内存不足。它使用大约 22 MB,W3WP 使用大约 70 MB。 SQL Server 已消耗了剩余 4 GB RAM 的大部分。有足够的磁盘空间。这些错误每隔几个小时就会在事件日志中出现一次。
任何建议将不胜感激。
更新
向机器添加更多 RAM 有助于解决问题(并且内存不足异常已经消失),但是,我仍然遇到问题。
对于某些用户来说,在同步之前似乎需要很长时间在数据库上运行“数据验证”任务(我说的是 > 20 分钟),这可能是导致问题的原因。
I am using SQL Server 2008 CE replication, and seem to be suffering some data loss (i.e. records are not appearing on the CE databases after a full sync).
I am getting the following entries in the application log:
Replication-Replication Merge Subsystem: agent 0033007B-0043-0039-4400-440036003300 failed. Internal error: A read operation from the device or the IIS server returned an incorrect number of bytes while trying to process a synchronization request. [,,,,,]
Replication-Replication Merge Subsystem: agent 0045007B-0038-0037-3200-430036004200 failed. Internal error: Either the computer running IIS is out of memory or an incorrect session ID was sent in a request. [Session id,,,,,]
Replication-Replication Merge Subsystem: agent 0033007B-0043-0039-4400-440036003300 failed. Validation of table row counts failed. Try resynchronizing. [,,,,,]
Replication-Replication Merge Subsystem: agent 0043007B-0036-0044-4400-320032003000 failed. The merge process could not initialize the subscription. Ensure that the subscription registration exists at the publisher, and reregister the subscription if necessary.
Replication-Replication Merge Subsystem: agent 0036007B-0037-0042-4500-370036003600 failed. Authentication failed on the computer running IIS. [,,,,,]
The messages seem to indicate that IIS is running out of RAM. It's using around 22 MB, and W3WP is using around 70 MB. SQL Server have consumed most of the remaining 4 GB of RAM. There is plenty of disk space. These error occur every few hours in the event log.
Any suggestions would be greatly appreciated.
Update
Add more RAM to the machine has helped the problem, (and the out of memory exceptions have gone) however, I'm still having problems.
It seems to take a very long time for some users to run a 'data validation' task on the database prior to syncronization (I'm talking > 20 mins) which I might be contributing to the problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我收到了这个确切的错误。实际问题是 IIS 池超时!因此,数据库越大,客户端处理的速度就越慢,直到设备花费超过 20 分钟来处理,这会导致池会话超时,这样当下一个请求到来时,后端就会阻塞。因此,一种选择是增加超时时间。但!!我使用的解决方案是增加客户端的进程缓冲区,如下所述:
http://blogs.msdn.com/b/sqlblog/archive/2009 /06/24/performance-tips-for-faster-download-of-a-large-sql-compact-3-5-database-via-replication.aspx
这是我在工作时的帖子http://social.msdn.microsoft.com/Forums/sqlserver/en-US/f9414df5-f066-450c-8e26-6f4c62a3897a/iis-replication-agent-restarts-replication-never-finishes
另外一个有趣的想法是,您可以在 PC 上进行一次合并,然后将该文件部署到设备上,显然可能不适合您的场景。
I was getting this exact error. The actual problem was the IIS Pool timeout! So, the larger the database the slower and slower the client is to process until it takes the device more then 20 minutes to process which causes the Pool session to timeout so that when the next request comes it the backend chokes. So, one option is to increase the timeout. BUT!! The solution I used was to increase the process buffer on the client side as described here:
http://blogs.msdn.com/b/sqlblog/archive/2009/06/24/performance-tips-for-faster-download-of-a-large-sql-compact-3-5-database-via-replication.aspx
Here is my post when I was working thru this http://social.msdn.microsoft.com/Forums/sqlserver/en-US/f9414df5-f066-450c-8e26-6f4c62a3897a/iis-replication-agent-restarts-replication-never-finishes
Also one interesting thought is you can do the merge on a PC once and then deploy that file to the devices, obviously may not fit your scenario.
我放弃了解决问题,并放弃了 SQL Mobile 复制,转而使用 Web 服务实现我自己的同步接口 :Ø(
I gave up on solving the problem, and abandoned SQL Mobile Replication in favour of implementing my own sync interface using web services :¬(