合并复制错误:您无权运行“SP_TRACE_GENERATEEVENT”

时间:2018-05-18 14:50:32

标签: sql sql-server sql-server-2012

我已经设置了合并复制。服务器DUCKDUCK1-1是分销商和出版商。服务器DUCKDUCK-2是订户。

我只复制了一个小表(这是一个测试)。

正在复制该表(但在订阅者上它是空的。)

显示的错误显示:

Error messages:
You do not have permission to run 'SP_TRACE_GENERATEEVENT'. (Source: MSSQLServer, Error number: 8189)
Get help: http://help/8189
The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)
Get help: http://help/MSSQL_REPL-2147201001

详细日志说明如下:

2018-05-18 14:41:34.856 Microsoft SQL Server Merge Agent 11.0.5058.0
2018-05-18 14:41:34.866 Copyright (c) 2008 Microsoft Corporation
2018-05-18 14:41:34.870 Microsoft SQL Server Replication Agent: replmerg
2018-05-18 14:41:34.874 
2018-05-18 14:41:34.877 The timestamps prepended to the output lines are expressed in terms of UTC time.
2018-05-18 14:41:34.879 User-specified agent parameter values:
            -Publisher DUCKDUCK-1-1
            -PublisherDB mydatabase
            -Publication Replication2018
            -Subscriber DUCKDUCK-2
            -SubscriberDB mydatabase
            -Distributor DUCKDUCK-1-1
            -DistributorSecurityMode 1
            -Continuous
            -OutputVerboseLevel 2
            -Output \\DUCKDUCK-1-1\snapshot_replicacion\salida.txt
            -XJOBID 0x307666C42266374F956FDBF68CA326E6
            -XJOBNAME DUCKDUCK-1-1-mydatabase-Replication2018-DUCKDUCK-2-1
            -XSTEPID 2
            -XSUBSYSTEM Merge
            -XSERVER DUCKDUCK-1-1
            -XCMDLINE 0
            -XCancelEventHandle 0000058C
            -XParentProcessHandle 00000614
2018-05-18 14:41:34.922 Percent Complete: 0
2018-05-18 14:41:34.926 Connecting to Distributor 'DUCKDUCK-1-1'
2018-05-18 14:41:34.929 Connecting to OLE DB Distributor at datasource: 'DUCKDUCK-1-1', location: '', catalog: '', providerstring: '' using provider 'SQLNCLI11'
2018-05-18 14:41:34.965 OLE DB Distributor: DUCKDUCK-1-1
            DBMS: Microsoft SQL Server
            Version: 11.00.5058
            catalog name: 
            user name: dbo
            API conformance: 0
            SQL conformance: 0
            transaction capable: 1
            read only: F
            identifier quote char: "
            non_nullable_columns: 0
            owner usage: 15
            max table name len: 128
            max column name len: 128
            need long data len: 
            max columns in table: 1000
            max columns in index: 16
            max char literal len: 131072
            max statement len: 131072
            max row size: 131072
2018-05-18 14:41:34.969 OLE DB Distributor 'DUCKDUCK-1-1': select SERVERPROPERTY ('ProductVersion') 
2018-05-18 14:41:34.972 OLE DB Distributor 'DUCKDUCK-1-1': {call sp_helpdistpublisher (N'DUCKDUCK-1-1') }
2018-05-18 14:41:34.977 OLE DB Distributor 'DUCKDUCK-1-1': {call sp_MShelp_repl_agent (N'DUCKDUCK-1-1', N'mydatabase', N'Replication2018', N'DUCKDUCK-2', N'mydatabase', 1)}
2018-05-18 14:41:34.983 OLE DB Distributor 'DUCKDUCK-1-1': select datasource, srvid from master..sysservers where upper(srvname) = upper(N'DUCKDUCK-1-1')
2018-05-18 14:41:34.987 OLE DB Distributor 'DUCKDUCK-1-1': {call sp_MShelp_merge_agentid (0,N'mydatabase',N'Replication2018',null,N'mydatabase',90,N'DUCKDUCK-2')}
2018-05-18 14:41:34.992 OLE DB Distributor 'DUCKDUCK-1-1': {call sp_MShelp_profile (1, 4, N'')}
2018-05-18 14:41:34.995 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_get_redirected_publisher(N'DUCKDUCK-1-1',N'mydatabase',0)}
2018-05-18 14:41:34.999 Percent Complete: 0
2018-05-18 14:41:34.999 Connecting to OLE DB Publisher at datasource: 'DUCKDUCK-1-1', location: '', catalog: 'mydatabase', providerstring: '' using provider 'SQLNCLI11'
2018-05-18 14:41:35.002 Initializing
2018-05-18 14:41:35.008 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.010 OLE DB Publisher: DUCKDUCK-1-1
            DBMS: Microsoft SQL Server
            Version: 11.00.5058
            catalog name: mydatabase
            user name: dbo
            API conformance: 0
            SQL conformance: 0
            transaction capable: 1
            read only: F
            identifier quote char: "
            non_nullable_columns: 0
            owner usage: 15
            max table name len: 128
            max column name len: 128
            need long data len: 
            max columns in table: 1000
            max columns in index: 16
            max char literal len: 131072
            max statement len: 131072
            max row size: 131072
2018-05-18 14:41:35.014 Percent Complete: 0
2018-05-18 14:41:35.014 OLE DB Publisher 'DUCKDUCK-1-1': set nocount on declare @dbname sysname select @dbname = db_name() declare @collation nvarchar(255) select @collation = convert(nvarchar(255), databasepropertyex(@dbname, N'COLLATION')) select collationproperty(@collation, N'CODEPAGE') as 'CodePage', collationproperty(@collation, N'LCID') as 'LCID', collationproperty(@collation, N'COMPARISONSTYLE') as 'ComparisonStyle',cast(case when convert (int,databasepropertyex (@dbname,'comparisonstyle')) & 0x1 = 0x1 then 0 else 1 end as bit) as DB_CaseSensitive,cast(case when convert (int,serverproperty ('comparisonstyle')) & 0x1 = 0x1 then 0 else 1 end as bit) as Server_CaseSensitive set nocount off
2018-05-18 14:41:35.017 Validating publisher
2018-05-18 14:41:35.021 OLE DB Publisher 'DUCKDUCK-1-1': select SERVERPROPERTY ('ProductVersion') 
2018-05-18 14:41:35.024 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.028 Connecting to OLE DB Publisher at datasource: 'DUCKDUCK-1-1', location: '', catalog: 'mydatabase', providerstring: '' using provider 'SQLNCLI11'
2018-05-18 14:41:35.031 Percent Complete: 0
2018-05-18 14:41:35.034 Connecting to Publisher 'DUCKDUCK-1-1'
2018-05-18 14:41:35.036 OLE DB Publisher: DUCKDUCK-1-1
            DBMS: Microsoft SQL Server
            Version: 11.00.5058
            catalog name: mydatabase
            user name: dbo
            API conformance: 0
            SQL conformance: 0
            transaction capable: 1
            read only: F
            identifier quote char: "
            non_nullable_columns: 0
            owner usage: 15
            max table name len: 128
            max column name len: 128
            need long data len: 
            max columns in table: 1000
            max columns in index: 16
            max char literal len: 131072
            max statement len: 131072
            max row size: 131072
2018-05-18 14:41:35.037 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.051 OLE DB Distributor 'DUCKDUCK-1-1': {call sp_MShelp_repl_agent (N'DUCKDUCK-1-1', N'mydatabase', N'Replication2018', N'DUCKDUCK-2', N'mydatabase', 1)}
2018-05-18 14:41:35.055 Connecting to OLE DB Subscriber at datasource: 'DUCKDUCK-2', location: '', catalog: 'mydatabase', providerstring: '' using provider 'SQLNCLI11'
2018-05-18 14:41:35.072 OLE DB Subscriber: DUCKDUCK-2
            DBMS: Microsoft SQL Server
            Version: 11.00.6020
            catalog name: mydatabase
            user name: clientes
            API conformance: 0
            SQL conformance: 0
            transaction capable: 1
            read only: F
            identifier quote char: "
            non_nullable_columns: 0
            owner usage: 15
            max table name len: 128
            max column name len: 128
            need long data len: 
            max columns in table: 1000
            max columns in index: 16
            max char literal len: 131072
            max statement len: 131072
            max row size: 131072
2018-05-18 14:41:35.077 OLE DB Subscriber 'DUCKDUCK-2': select SERVERPROPERTY ('ProductVersion') 
2018-05-18 14:41:35.081 OLE DB Subscriber 'DUCKDUCK-2': set nocount on declare @dbname sysname select @dbname = db_name() declare @collation nvarchar(255) select @collation = convert(nvarchar(255), databasepropertyex(@dbname, N'COLLATION')) select collationproperty(@collation, N'CODEPAGE') as 'CodePage', collationproperty(@collation, N'LCID') as 'LCID', collationproperty(@collation, N'COMPARISONSTYLE') as 'ComparisonStyle',cast(case when convert (int,databasepropertyex (@dbname,'comparisonstyle')) & 0x1 = 0x1 then 0 else 1 end as bit) as DB_CaseSensitive,cast(case when convert (int,serverproperty ('comparisonstyle')) & 0x1 = 0x1 then 0 else 1 end as bit) as Server_CaseSensitive set nocount off
2018-05-18 14:41:35.085 Percent Complete: 0
2018-05-18 14:41:35.085 OLE DB Subscriber 'DUCKDUCK-2': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.088 Connecting to Subscriber 'DUCKDUCK-2'
2018-05-18 14:41:35.093 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.094 OLE DB Subscriber 'DUCKDUCK-2': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.099 Percent Complete: 0
2018-05-18 14:41:35.102 Retrieving publication information
2018-05-18 14:41:35.104 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.110 Percent Complete: 0
2018-05-18 14:41:35.113 Retrieving subscription information.
2018-05-18 14:41:35.114 OLE DB Subscriber 'DUCKDUCK-2': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.115 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.123 Percent Complete: 0
2018-05-18 14:41:35.127 Applying the snapshot to the Subscriber
2018-05-18 14:41:35.129 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.190 OLE DB Distributor 'DUCKDUCK-1-1': select datasource, srvid from master..sysservers where upper(srvname) = upper(N'DUCKDUCK-1-1')
2018-05-18 14:41:35.193 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_mergesubentry_indistdb (0,N'DUCKDUCK-1-1',N'mydatabase',N'Replication2018',N'DUCKDUCK-2',N'mydatabase',0,1,0,N'',?,90)}
2018-05-18 14:41:35.201 Connecting to OLE DB Subscriber at datasource: 'DUCKDUCK-2', location: '', catalog: 'mydatabase', providerstring: '' using provider 'SQLNCLI11'
2018-05-18 14:41:35.209 OLE DB Subscriber: DUCKDUCK-2
            DBMS: Microsoft SQL Server
            Version: 11.00.6020
            catalog name: mydatabase
            user name: clientes
            API conformance: 0
            SQL conformance: 0
            transaction capable: 1
            read only: F
            identifier quote char: "
            non_nullable_columns: 0
            owner usage: 15
            max table name len: 128
            max column name len: 128
            need long data len: 
            max columns in table: 1000
            max columns in index: 16
            max char literal len: 131072
            max statement len: 131072
            max row size: 131072
2018-05-18 14:41:35.213 OLE DB Subscriber: DUCKDUCK-2
            DBMS: Microsoft SQL Server
            Version: 11.00.6020
            catalog name: mydatabase
            user name: clientes
            API conformance: 0
            SQL conformance: 0
            transaction capable: 1
            read only: F
            identifier quote char: "
            non_nullable_columns: 0
            owner usage: 15
            max table name len: 128
            max column name len: 128
            need long data len: 
            max columns in table: 1000
            max columns in index: 16
            max char literal len: 131072
            max statement len: 131072
            max row size: 131072
2018-05-18 14:41:35.220 OLE DB Subscriber 'DUCKDUCK-2': sp_MSacquiresnapshotdeliverysessionlock
2018-05-18 14:41:35.223 OLE DB Subscriber 'DUCKDUCK-2': sp_MStrypurgingoldsnapshotdeliveryprogress
2018-05-18 14:41:35.231 OLE DB Subscriber 'DUCKDUCK-2': sp_MSissnapshotitemapplied @snapshot_session_token = N'\\DUCKDUCK-1-1\snapshot_replicacion\unc\DUCKDUCK-1-1_mydatabase_Replication2018\20180518112431\', @snapshot_progress_token = N'\\DUCKDUCK-1-1\snapshot_replicacion\unc\DUCKDUCK-1-1_mydatabase_Replication2018\20180518112431\provincias_2.sch'
2018-05-18 14:41:35.235 OLE DB Subscriber 'DUCKDUCK-2': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.252 [18%] OLE DB Subscriber 'DUCKDUCK-2': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
  Ƶ 騰Ā  ꌸƵ硦燠ꍜƵὀ Ἷ 姸gꍜƵPercent Complete: 18
2018-05-18 14:41:35.258 Skipping file 'provincias_2.sch' because it has already been delivered for a previous article or by a previously interrupted snapshot.
2018-05-18 14:41:35.261 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.270 The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write.[18%] 
  Ƶ 騰Ā  ꌸƵ硦燠ꍜƵὀ Ἷ 姸gꍜƵPercent Complete: 18
2018-05-18 14:41:35.276 OLE DB Subscriber 'DUCKDUCK-2': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.279 Preparing table 'provincias' for merge replication
2018-05-18 14:41:35.285 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.292 Percent Complete: 18
2018-05-18 14:41:35.295 You do not have permission to run 'SP_TRACE_GENERATEEVENT'.
2018-05-18 14:41:35.297 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.342 Percent Complete: 0
2018-05-18 14:41:35.345 Category:SQLSERVER
Source:  DUCKDUCK-2
Number:  8189
Message: You do not have permission to run 'SP_TRACE_GENERATEEVENT'.
2018-05-18 14:41:35.351 Percent Complete: 0
2018-05-18 14:41:35.354 Category:NULL
Source:  Merge Replication Provider
Number:  -2147201001
Message: The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write.
2018-05-18 14:41:35.357 Disconnecting from OLE DB Subscriber 'DUCKDUCK-2'
2018-05-18 14:41:35.360 Disconnecting from OLE DB Subscriber 'DUCKDUCK-2'
2018-05-18 14:41:35.363 Disconnecting from OLE DB Subscriber 'DUCKDUCK-2'
2018-05-18 14:41:35.365 Disconnecting from OLE DB Subscriber 'DUCKDUCK-2'
2018-05-18 14:41:35.368 Disconnecting from OLE DB Publisher 'DUCKDUCK-1-1'
2018-05-18 14:41:35.372 Disconnecting from OLE DB Publisher 'DUCKDUCK-1-1'
2018-05-18 14:41:35.375 Disconnecting from OLE DB Publisher 'DUCKDUCK-1-1'
2018-05-18 14:41:35.378 Disconnecting from OLE DB Publisher 'DUCKDUCK-1-1'
2018-05-18 14:41:35.380 Disconnecting from OLE DB Distributor 'DUCKDUCK-1-1'
2018-05-18 14:41:35.383 Disconnecting from OLE DB Distributor 'DUCKDUCK-1-1'
2018-05-18 14:41:35.386 The merge process will restart after waiting 30 second(s)...

无法弄清楚发生了什么。

2 个答案:

答案 0 :(得分:1)

根据Microsoft文档:

  XML订阅服务器的

COM对象初始化失败。合并复制未将模式更改应用于订阅服务器的一些原因包括:

     
      
  • 创建目录以写入临时快照文件失败。

  •   
  • 无法枚举架构文章。

  •   
  • 对于SQL Server Compact订阅服务器,无法重新初始化   订阅。

  •   
  • 如果对象基于消息,则无法写入消息   文件。

  •   

您是否已为SQL Server分配了足够的内存,并且是否正在填充任何东西,例如事务日志或磁盘?

来源:https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2012/dd581610(v=sql.110)

答案 1 :(得分:1)

sp_trace_generateevent在SQL Server中创建一个用户定义的事件。参见sp_trace_generateevent

用户必须具有ALTER TRACE权限。

授予SQL复制服务帐户对发布服务器的“更改跟踪”权限。

  

步骤1:以sys admin权限登录到SQL Server(发布者)。

     

第2步:导航到服务器属性,然后导航到“权限”选项卡。

     

第3步:选择用于在其上运行复制的帐户   订阅SQL Server。在此示例中是帐户   “ ADMS-SINC91LTZ1”,然后单击“ Alter Trace”授予对   它。

     

第4步:在订阅服务器上停止并启动SQL Merge Agent

相关问题