Search code examples
replicationsql-server-2012transactional-replication

"Uninitialized subscription" error in replication monitor


I'm using SQL Server 2012 and trying to implement transactional replication. Im using the system stored procedures to create the publications and subscriptions. I was successful in creating these things, but when i check the replication monitor, it shows "Uninitialized subscription".

When I check the synchronization status on the subscription, i found this log

Date        6/20/2012 7:36:33 PM
Log     Job History (HYDHTC0131320D-PublisherDB-PublicationOne-HYDHTC0131320D\MSS-ReplicationSubscri-7C1D7509-C8A6-4073-A901-0433A2B6D2D3)

Step ID     1
Server      HYDHTC0131320D\MSSQLSERVER2
Job Name        HYDHTC0131320D-PublisherDB-PublicationOne-HYDHTC0131320D\MSS-ReplicationSubscri-7C1D7509-C8A6-4073-A901-0433A2B6D2D3
Step Name       Run agent.
Duration        00:07:41
Sql Severity    0
Sql Message ID  0
Operator Emailed    
Operator Net sent   
Operator Paged  
Retries Attempted   0

Message
2012-06-20 14:14:13.986 Copyright (c) 2008 Microsoft Corporation
2012-06-20 14:14:13.986 Microsoft SQL Server Replication Agent: distrib
2012-06-20 14:14:13.986 
2012-06-20 14:14:13.986 The timestamps prepended to the output lines are expressed in terms of UTC time.
2012-06-20 14:14:13.986 User-specified agent parameter values:
            -Publisher HYDHTC0131320D
            -PublisherDB PublisherDB
            -Publication PublicationOne
            -Distributor HYDHTC0131320D
            -SubscriptionType 2
            -Subscriber HYDHTC0131320D\MSSQLSERVER2
            -SubscriberSecurityMode 1
            -SubscriberDB ReplicationSubscriberDB
            -Continuous
            -XJOBID 0xDFE51AEC7F9E3F42A450CE8874B662CD
            -XJOBNAME HYDHTC0131320D-PublisherDB-PublicationOne-HYDHTC0131320D\MSS-ReplicationSubscri-7C1D7509-C8A6-4073-A901-0433A2B6D2D3
            -XSTEPID 1
            -XSUBSYSTEM Distribution
            -XSERVER HYDHTC0131320D\MSSQLSERVER2
            -XCMDLINE 0
            -XCancelEventHandle 000005F8
            -XParentProcessHandle 00000560
2012-06-20 14:14:13.986 Startup Delay: 619 (msecs)
2012-06-20 14:14:14.606 Connecting to Subscriber 'HYDHTC0131320D\MSSQLSERVER2'
2012-06-20 14:14:14.656 Connecting to Distributor 'HYDHTC0131320D'
2012-06-20 14:14:14.671 Parameter values obtained from agent profile:
            -bcpbatchsize 2147473647
            -commitbatchsize 100
            -commitbatchthreshold 1000
            -historyverboselevel 1
            -keepalivemessageinterval 300
            -logintimeout 15
            -maxbcpthreads 1
            -maxdeliveredtransactions 0
            -pollinginterval 5000
            -querytimeout 1800
            -skiperrors 
            -transactionsperhistory 100
2012-06-20 14:14:14.683 Agent message code 21040. Publication '' does not exist.

How do I solve this issue?


Solution

  • It seems there is an error in your replication setup scripts.

    I suspect the error is in the call to sp_addpushsubscription_agent (if it is push subscription) or sp_addpullsubscription_agent (if it is pull subscription). Specifically the @publication parameter is wrong as the Distribution Agent is stating that the specified Publication " does not exist.

    Please review your script and try again.