Symptomen
U wordt ervan uitgegaan dat u een Microsoft SQL Server 2008 R2-, SQL Server 2012-of SQL Server 2014 transactionele replicatieomgeving hebt. De omgeving bevat meerdere distributie versies van SQL Server. In deze situatie kan een toegangsfout optreden en wordt de distributieagent van de SQL Server-replicatie vastlopen. Daarnaast wordt er een minidumpbestand gegenereerd.
Oplossing
Nadat u de hotfix hebt toegepast, wordt de agent niet goed afgesloten in plaats van met een dumpbestand. U kunt een extra functie stap toevoegen in de distributie agent om de agent automatisch opnieuw te starten als de agent is gestopt en de status gepland voor opnieuw opstarten is uitgeschakeld. Zie voor meer informatie over het toevoegen van een extra project stap in de taak distributie agent. Het probleem is voor het eerst opgelost in de volgende cumulatieve update van SQL Server.
Cumulatieve update 1 voor SQL Server 2014 /en-us/help/2931693
Cumulatieve update 9 voor SQL Server 2012 SP1 /en-us/help/2931078
Cumulatieve update 11 voor SQL Server 2012 /en-us/help/2908007
Cumulatieve update 9 voor SQL Server 2008 R2 SP2 /en-us/help/2887606
Elke nieuwe cumulatieve update voor SQL Server bevat alle hotfixes en alle beveiligingsoplossingen die zijn opgenomen in de vorige cumulatieve update. Bekijk de nieuwste cumulatieve updates voor SQL Server:
Hotfix-updatepakket voor SQL Server 2008 R2 Service Pack 1De oplossing voor dit probleem werd voor het eerst uitgebracht in het hotfix-updatepakket voor SQL Server 2008 R2 Service Pack 1.
Status
Microsoft heeft bevestigd dat dit probleem zich kan voordoen in de Microsoft-producten die worden vermeld in de sectie Van toepassing op.
Meer informatie
Wanneer u de hotfix toepast, voegt u het volgende script toe aan de taak van de distributie agent:DECLARE @JobID BINARY(16)DECLARE @AgentID intDECLARE @command varchar(max)DECLARE JobCur CURSOR FOR SELECT Job.job_id, Agent.id FROM msdb.dbo.sysjobs AS Job INNER JOIN msdb.dbo.syscategories AS Cat ON Job.category_id = Cat.category_id INNER JOIN msdb.dbo.sysjobsteps AS Steps ON Job.job_id = Steps.job_id INNER JOIN distribution.dbo.MSdistribution_agents AS Agent ON Job.job_id = Agent.job_id WHERE Job.name like '%Put Text Mask To Identify Your Publisher DB Jobs Here%' AND Cat.name = 'REPL-Distribution' GROUP BY Job.job_id, Agent.id HAVING COUNT(step_id) = 3OPEN JobCurFETCH NEXT FROM JobCur INTO @JobID, @AgentIDWHILE @@FETCH_STATUS = 0 BEGIN IF (@JobID is not NULL) BEGIN set @command = N'if (select top 1 runstatus from MSdistribution_history where agent_id = ' + convert(varchar, @AgentID)+ N' order by timestamp desc) = 5 raiserror(''Agent was scheduled for retry. Performing restart now'',16,1)' EXEC msdb.dbo.sp_add_jobstep @job_id=@JobID, @database_name=N'distribution', @step_name=N'Check for retry', @step_id=4, @on_fail_action=4, @on_fail_step_id=1, @command=@command EXEC msdb.dbo.sp_update_jobstep @job_id=@JobID, @step_id=2, @on_success_action=4, @on_success_step_id=4 END FETCH NEXT FROM JobCur INTO @JobID, @AgentID;ENDCLOSE JobCur;DEALLOCATE JobCur;GO