代码之家  ›  专栏  ›  技术社区  ›  Stephen H. Anderson

合并复制错误:您没有运行“SP_TRACE_GENERATEEVENT”的权限

  •  10
  • Stephen H. Anderson  · 技术社区  · 8 年前

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

    显示的错误是:

    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 回复  |  直到 8 年前
        1
  •  1
  •   NotoriousPyro    8 年前

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

    • 无法创建用于写入临时快照文件的目录。

    • 枚举架构项目失败。

    • 对于SQL Server Compact订阅服务器,未能重新初始化

    • 如果对象是基于消息的,则无法写入消息

    您是否已为SQL Server分配了足够的内存,是否有事务日志或磁盘之类的内容已满?

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

        2
  •  1
  •   CR241    7 年前

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

    用户必须具有 ALTER TRACE

    向SQL复制服务帐户授予发布服务器的Alter Trace权限。

    sys admin 权利。

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

    步骤3:选择用于在上运行复制的帐户 订阅的SQL Server。在本例中,它是 Alter Trace “准许 它。

    步骤4:停止并启动订阅服务器上的SQL合并代理