replmerg.exe

Hello All,

I am having problems with my merge replication job. I have recently upgraded sql server on of my test server from 2000 to 2005. Ever since I couldn't get this job to run. I keep getting the following error.
-------------------------------------------------------------------------------------------
Date        11/30/2005 2:57:00 PM
Log        Job History (TEST_Merge_Sync)

Step ID        6
Server        TEST
Job Name        TEST_Merge_Sync
Step Name        Merge_TEST_PUBS
Duration        00:00:00
Sql Severity        0
Sql Message ID        0
Operator Emailed       
Operator Net sent       
Operator Paged       
Retries Attempted        0

Message
The step is improperly defined and so could not be run.  The step failed.
-------------------------------------------------------------------------------------------

But if I execute it from command line by going to directory where replmerg.exe exists it work perfectly, but can't get it working from the sql job.

I also see this error in the agent log, what does this mean
-------------------------------------------------------------------------------------------
Date        11/30/2005 3:33:52 PM
Log        SQL Agent (Current - 11/30/2005 3:33:00 PM)

Message
[LOG] Unable to read local eventlog (reason: The parameter is incorrect)
-------------------------------------------------------------------------------------------

Any kind of help is greatly appreciated.

Thank you all,
Murali.



Answer this question

replmerg.exe

  • Lasfargues pierre

    Hi Murali,

    Could you trace the agent job execution with RPC SP, statement, StatementBatch starting/completed please and see if there is something that can help. 

  • Shargon

    You can look into sysmergepublications and sysmergesubscriptions on the publisher and subscriber databases for each publication/subscription to find out if the publication and subscription are setup correctly.
    On the publisher you will notice an entry in sysmergepublications and the same entry should exist on the subscriber.
    In sysmergesubscriptions, there should be 2 entries. One corresponding to the remote server with the publication id and the other entry for the local server with publicationid=subscriptionid.
    This should be the same on publisher and subscriber.

    Books Online should have more information regarding these.

  • Guna Natarajan

    Here is the command. This is exactly same thing that executed from command prompt. I get a feeling that some how when it is executed from the job it couldn't find the replmerg.exe.

    -Publisher TESTSERVER  -PublisherDB TEST_PUBS -Publication TEST_PUBS -PublisherSecurityMode 0 -PublisherLogin sa -PublisherPassword password -DistributorSecurityMode 0 -DistributorLogin sa -DistributorPassword password -Distributor TESTSERVER -Subscriber TEST -SubscriberDB TEST_PUBS -SubscriptionType 1 -SubscriberSecurityMode 0 -SubscriberLogin sa -SubscriberPassword password -FileTransferType 0 -LoginTimeout 300 -QueryTimeout 600

    Thank you,
    Murali



  • johnvarney

    Hello All,

    This is what I further found. I created a merge publication on a 2005 server on pubs database. Now on a client machine which is also 2005 server, I created the subscription manually from SQL Server Management Studio, this created a repl-merge job and this would work fine. Now I created a job manually just the way SQL Server did, but when I try to execute the job it would fail with the same "Message: The step is improperly defined and so could not be run.  The step failed.". What am I doing wrong.

    Appreciate all your help,

    Thank you,
    Murali.


  • PGolini

    Hello Mahesh,

    I have ran the sql profiler but couldn't find anything. I am not sure what I am looking for though.

    I found couple of these statements, I am not sure if they mean anything.

    SELECT StatMan([SC0]) FROM (SELECT TOP 100 PERCENT [category_id] AS [SC0] FROM
    [dbo].[#tmp_sp_help_category_______________________________________________________________________________________________00000000001E] WITH
    (READUNCOMMITTED,SAMPLE 1.000000e+002 PERCENT)  ORDER BY [SC0]) AS _MS_UPDSTATS_TBL

    Let me know if you need anything else.

    My Publisher is 2005, and a 2000 subscription works perfectly normal to it. But 2005 subscription doesn't.

    Thank you,
    Murali


  • DasFox

    On the error in the log, we have an existing bug for this and is planned to addressed in next public release.

    On the job failure note, Mahesh will follow up with you.

    Thanks,
    Gops Dwarak

  • SameerVartak

    Why do you want to create the job manually
    You may have to create the job steps exactly the way they are when the job is created as part of the subscription for it to succeed.

  • Masud Moshtaghi

    Nope I was not creating manually I was just trying to duplicate the error that I was getting. We have a subscription process in place which works great for SQL Server 2000, and I was trying to use the same to work for SQL Server 2005.

    When I upgraded to 2005, I have to install SQLServer2005_BC.msi for SQL-DMO stuff to work on SQL Server 2000 machines, but when ever I do a foreach on the database or views or tables collection that was returned by SQL-DMO objects it failed so I have to change all those to loop through the count returned by these objects.

    I think I got all this working untill to point of running the merge job. Some how the merge job that I created from SQL DMO would not work. I errors out. Any ideas

    How can I check (say system tables) that all my subscription settings where created right by the SQL-DMO. Can any one point me to a documentation or an article where I can find this information. I am trying to validate my publisher and subscriber to see all the settings where right. So that I can narrow down my problem further down.

    Thank you for all your support and help,



  • AlpsInOz

    Hi Murali,

    Looks like you may be using a parameter in merge agent that is not supported anymore
    Can you post the select command from msdb..sysjobsteps for this merge agent



  • replmerg.exe