0

I have a single merge replication with pull subscribers (Sql Express 2008R2) and Sql Server 2008R2 as publisher. I want to turn logging on for specific subscribers only for occasional debugging. SSMS on subscriber machines is not an option.

I know I should use 'optional_command_line' and set '-Output' property when creating merge agent at the subscriber (http://msdn.microsoft.com/en-us/library/ms187722.aspx).

But I created the agent and scheduled in sync center already many months back and now want to edit the agent's properties- set its output path and verbosity level temporarily on some subscriber machines.

Is there a way to do this without having to redo the whole subscription? Something like this here (http://support.microsoft.com/kb/312292) but only a non gui version of what they suggest.

What are my options? Without explicit -Output specified, output is sent 'to the console' as per this(http://msdn.microsoft.com/en-us/library/ms147839.aspx). If my merge schedule is through sync center, where can I find this logged info, if I haven't sepcified my log file specifically?

Brandon Williams
  • 3,695
  • 16
  • 19
Brian
  • 1,337
  • 5
  • 17
  • 34

1 Answers1

1

Agent output to file cannot be done through Sync Center. You will need to synchronize on-demand from the command line in order to enable verbose agent logging to file with SQL Server Express. To run the Merge Agent from the command line, execute replmerg.exe from the COM folder. It will look something like this:

enter image description here

This example outputs the verbose Merge Agent log to C:\TEMP\mergeagent.log. You will need to update the replmerg.exe parameter values according to your environment.

Brandon Williams
  • 3,695
  • 16
  • 19
  • You are right! In my test environment I created a test subscription with optional_command_line = N'-Output C:\replicationLogs\TestLog.log' but no luck. In general for pull subscriptions, what is a better approach to schedule? Avoid Sync center altogether and schedule a batch script to run replmerg.exe? Performance-wise, -Output option is ok in production? May be with -OutputVerboseLevel 1? – Brian Jan 15 '13 at 16:44
  • -Output and -OutputVerboseLevel options should only be used when troubleshooting. Sync Center is fine if it is working for you, just keep in mind you will have to execute replmerge.exe from the command line on-demand to use -Output and -OutputVerboseLevel. If Sync Center is giving you problems then yes, execute replmerge.exe in a batch script as a scheduled task. – Brandon Williams Jan 16 '13 at 00:14
  • Thank you. Just to confirm, so there is no 'default' location to look at replication logs when using Sync Center right? – Brian Jan 16 '13 at 15:00
  • That is correct. There is Replication Monitor on the publisher side which will show default session information but there is no way to get the verbose agent log subscriber side using Sync Center. – Brandon Williams Jan 16 '13 at 17:56