我的SQL Server版本是2012 R2。我有一台出版机,其中有几份出版物、一台发行机和几台订阅机。一切正常。
但是,当我尝试在其中一个发布者上添加新订阅(该数据库的大小接近 150 GB)并启动代理创建快照时,当达到 99% 时,它会向我显示以下错误消息,基于根据提供的信息,有一些查询超时的迹象。
我检查了设置:属性->连接->远程查询超时值为0,这意味着远程查询的持续时间没有限制。请各位指教,谢谢大家!
Error Message:
Message: A transport-level error occurred when sending the request to the server. (provider: TCP Provider, error: 0 - The remote host forcibly closed an existing connection.)
Command Text: sp_MSget_synctran_commands Parameters: @publication = xxxx_publish
Stack:
at Microsoft.SqlServer.Replication.AgentCore.ReMapSqlException(SqlException e, SqlCommand command)
at Microsoft.SqlServer.Replication.AgentCore.AgentExecuteReader(SqlCommand command, Int32 queryTimeout, CommandBehavior commandBehavior)
at Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate commandSetupDelegate, ProcessResultsDelegate processResultsDelegate, Int32 queryTimeout, CommandBehavior commandBehavior)
at Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate commandSetupDelegate, ProcessResultsDelegate processResultsDelegate)
at Microsoft.SqlServer.Replication.Snapshot.TransSnapshotCommandManager.AddSyncTranCommands()
at Microsoft.SqlServer.Replication.Snapshot.TransSnapshotCommandManager.AddSnapshotCommands()
at Microsoft.SqlServer.Replication.Snapshot.TransSnapshotProvider.AddTransCommandsAndSetArticleTranIDTransaction(SqlConnection connection)
at Microsoft.SqlServer.Replication.RetryableSqlServerTransactionManager.ExecuteTransaction(Boolean bLeaveTransactionOpen)
at Microsoft.SqlServer.Replication.Snapshot.TransSnapshotProvider.DoConcurrentPostArticleFilesGenerationProcessing()
at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: MSSQLServer, Error Number: 10054) Get Help: http://help/10054
Server xxxx, Level 20, State 0, Line 0
A transport-level error occurred when sending the request to the server. (provider: TCP Provider, error: 0 - The remote host forcibly closed an existing connection.) (Source: MSSQLServer, Error Number: 10054)
我不相信您因设置而出现查询超时。我的出版物开箱即用,需要几个小时才能同步到订阅者,而且从未超时。
相反,听起来这个新订阅服务器所在的服务器与源发布服务器之间的连接不稳定。无论网络设置如何,连接可能不稳定。不幸的是,我认为无论哪种方式,你都会遇到基础设施问题,而不是数据库问题。
可能对您有帮助的一件事是尝试从备份初始化订阅服务器。我相信您可以将备份文件保存在订阅服务器本地并在本地初始化。这消除了大多数基础设施问题。那么发布者不需要很长时间就能与订阅者同步。