Friday, March 9, 2012

Merge Replication example for SQL Server 2005

Hi guys,
I'm fighting against Merge Replication in SQL Server 2005.
I've tried several times to setup merge replication with a real example
but I can't. I've followed this instructions given by this "article" in
MSDN2 but there is no way:
http://msdn2.microsoft.com/en-us/library/ms171908.aspx
I guessed it's something related to permissions because I've migrated
by scripting an old publication I had in SQL Server 2000 to 2005 and
worked without problems.
In the above example another Windows user is created and at the end of
"Create Publication" step, in the "Agent Security" dialog box, I guess
you must enter this user's credentials. All OK. Publication is finished
and then I add IUSR_xxxxxx user to the Publication Access List.
Publication tries to create the initial snapshot but it always give
this error: "Executed as user: PC-Name\snapshot_agent. The step did not
generate any output. The step failed.".
Instead of adding this user in the mentioned dialog box, if I check
"Run under SQL Server Agent Account", publication created the initial
snapshot and works well.
Can anybody tell me if that example is working and is correct? I do not
want to check "run under SQL Server Agent Account", because it says
that it's a security bad practice.
Could somebody point me in the rigth direction please?
Thanks in advance.
It would appear that the login you supplied for running the snapshot agent
job did not have sufficient permissions to start the snapshot agent. One
probable cause is that PC-Name\snapshot_agent may not have read access to
%ProgramFiles%\Microsoft SQL Server\90\COM\snapshot.exe. In any case, you can
troubleshoot this further by starting a cmd shell using "runas
/user:PC-Name\snapshot_agent" on the distributor machine and see if you can
start snapshot.exe manually.
Hope that helps
-Raymond
"Lonifasiko" wrote:

> Hi guys,
> I'm fighting against Merge Replication in SQL Server 2005.
> I've tried several times to setup merge replication with a real example
> but I can't. I've followed this instructions given by this "article" in
> MSDN2 but there is no way:
> http://msdn2.microsoft.com/en-us/library/ms171908.aspx
> I guessed it's something related to permissions because I've migrated
> by scripting an old publication I had in SQL Server 2000 to 2005 and
> worked without problems.
> In the above example another Windows user is created and at the end of
> "Create Publication" step, in the "Agent Security" dialog box, I guess
> you must enter this user's credentials. All OK. Publication is finished
> and then I add IUSR_xxxxxx user to the Publication Access List.
> Publication tries to create the initial snapshot but it always give
> this error: "Executed as user: PC-Name\snapshot_agent. The step did not
> generate any output. The step failed.".
> Instead of adding this user in the mentioned dialog box, if I check
> "Run under SQL Server Agent Account", publication created the initial
> snapshot and works well.
> Can anybody tell me if that example is working and is correct? I do not
> want to check "run under SQL Server Agent Account", because it says
> that it's a security bad practice.
> Could somebody point me in the rigth direction please?
> Thanks in advance.
>
|||Hi Raymond, thanks for your help.
I have given the snapshot_agent user, rights to have "total control"
(instead of "read" you advised me) to "COM" folder, therefore, also to
"snapshot.exe" file.
I again opened SQL Server Management Studio, tried to start Snapshot
Agent and the same error appeared.
Then I tried to start it by command line this way:
runas /user:pc-1\snapshot_agent "C:\Archivos de programa\Microsoft SQL
Server\90\COM\snapshot.exe"
Asks me for the user password and seems like it starts running a
process because opens another command windows but is closed wihout me
seeing any result. I understand that means this user is able to run
snapshot agent.
What is happenning then? Have you tried yourself the example I gave you
in the link. I would really appreciate if you could try and post here
your results. Maybe I've forgotten something or you understand
something different that I did.
What about running the replication under SQL Server Agent Account? Is
it so insecure? As I told you, when migrating my old replication via
script, I noticed it was generated corretly in SQL Server 2005. Then I
opened publication's properties and could see that was running under
"SQL Server Agent account". All publications in SQL Server 2000 run
under this account? I don't remmeber me choosing between I think these
days I'll do it this way because it is the unique way it works ;-)
Please see if you can setup replication following the example and I'll
be willing for your reply.
Thanks very much again.

No comments:

Post a Comment