SQL Server 2019中的复制问题

Mag*_*s L 2 replication sql-server sql-server-2019

我已经安装了 SQL Server 2019 RC1,但无法创建快照。当我运行快照代理时,我不断收到相同的消息:

2019-10-30 12:32:41.59 Microsoft (R) SQL Server Snapshot Agent
2019-10-30 12:32:41.59 [Assembly Version = 15.0.0.0, File Version = 15.0.1900.25]
2019-10-30 12:32:41.59 Copyright (c) 2016 Microsoft Corporation.
2019-10-30 12:32:41.59 The timestamps prepended to the output lines are expressed in terms of UTC time.
2019-10-30 12:32:41.59 User-specified agent parameter values:
2019-10-30 12:32:41.59 --------------------------------------
2019-10-30 12:32:41.59 -Publisher DB100
2019-10-30 12:32:41.59 -PublisherDB REF3_DB
2019-10-30 12:32:41.59 -Publication REF3_PDR4
2019-10-30 12:32:41.59 -Distributor DB100
2019-10-30 12:32:41.59 -DistributorSecurityMode 1
2019-10-30 12:32:41.59 -XJOBID 0xA694274CD89FAF418C8B059F22C01B85
2019-10-30 12:32:41.59 --------------------------------------
2019-10-30 12:32:41.59 Connecting to Distributor 'DB100'
2019-10-30 12:32:41.64 Parameter values obtained from agent profile:
2019-10-30 12:32:41.64 ---------------------------------------------
2019-10-30 12:32:41.64 -BcpBatchSize 100000
2019-10-30 12:32:41.64 -HistoryVerboseLevel 2
2019-10-30 12:32:41.64 -LoginTimeout 15
2019-10-30 12:32:41.64 -QueryTimeout 1800
2019-10-30 12:32:41.64 ---------------------------------------------
2019-10-30 12:32:41.64 Validating Publisher
2019-10-30 12:32:41.64 Connecting to Publisher 'DB100'
2019-10-30 12:32:41.65 Publisher database compatibility level is set to 150.
2019-10-30 12:32:41.65 Retrieving publication and article information from the publisher database 'DB100.REF3_DB'
2019-10-30 12:32:41.65 [0%] Locking published tables while generating the snapshot
2019-10-30 12:32:41.67 [0%] The replication agent had encountered an exception.
2019-10-30 12:32:41.67 Source: Replication
2019-10-30 12:32:41.67 Exception Type: Microsoft.SqlServer.Replication.ReplicationAgentException
2019-10-30 12:32:41.67 Exception Message: An unspecified error had occurred in the native SQL Server connection component.
2019-10-30 12:32:41.67 Message Code: 55012
2019-10-30 12:32:41.67
Run Code Online (Sandbox Code Playgroud)

小智 8

我花了将近2天的时间才解决,但以下解决了我的问题

即使安装了最新的驱动程序,快照代理仍将使用 SQL Server 2019 附带的旧版本驱动程序。

这与您环境中的 Path 变量有关。查看系统属性、高级系统设置、环境变量、系统变量、路径。

除非您更改了默认设置,否则您会%SystemRoot%\system32%SystemRoot%顶部和C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\ 下方找到 、 。

您找不到的是64 位系统上最新 OLE 驱动程序安装位置的路径%SystemRoot%\SysWOW64\引用。%SystemRoot%\SysWOW64\1033驱动程序文件是msoledbsql.dllmsoledbsqlr.rll

因此,当快照代理启动时,它将使用相对于分支下某个位置的二进制文件安装的 OLE 驱动程序文件,C:\Program Files\Microsoft SQL Server\因为它在路径中找不到任何其他文件。

当您将%SystemRoot%\SysWOW64\%SystemRoot%\SysWOW64\1033插入系统路径变量(确保它位于对 C:\Program Files\Microsoft SQL Server... 的任何引用之上)并重新启动 SQL Server 实例时,您应该会发现问题消失了。

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/e2c23cda-9e78-4514-bae6-27c6d34767a4/sql-server-2019-snapshot-agent-error?forum=sqldatabaseengine