Showing posts with label real. Show all posts
Showing posts with label real. Show all posts

Wednesday, March 28, 2012

Merge Replication!

Can someone please advise what would be appropriate method when you want to
implement the merge replication (Kind of a Real time) between different
databases sitting on separate servers.
Is Auto Incremental Field which is PK would be a problem when two users try
to enter records at same time. For example in table#1 user "A" enter some
values at row#3 and got the Id 3,
While at the same time the users "B" in table#2 enter some values at
row#3...would he got Id 3 ? and how it would get replicated.
Do I need to use GUID as PK or some other suggestion?
Shan
Merge replication does not provide real time replication, use automatic
identity range management to avoid the pk conflicts. To do this, drop all
publications where the table you want to bring under automatic identity
range management is publisher. In the publication wizard when you come to
the specify articles dialog box, click on the browse button to the right of
your table name, and select the automatic identity range management tab.
Select a publisher and subscriber range which matches that maximum number of
inserts which might occur between agent syncs, and then make sure your
agents do not run continuously.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Shan" <Shan@.discussions.microsoft.com> wrote in message
news:C97F8918-2523-4064-A6EB-F7C1D7D67BE2@.microsoft.com...
> Can someone please advise what would be appropriate method when you want
to
> implement the merge replication (Kind of a Real time) between different
> databases sitting on separate servers.
> Is Auto Incremental Field which is PK would be a problem when two users
try
> to enter records at same time. For example in table#1 user "A" enter some
> values at row#3 and got the Id 3,
> While at the same time the users "B" in table#2 enter some values at
> row#3...would he got Id 3 ? and how it would get replicated.
> Do I need to use GUID as PK or some other suggestion?
> --
> Shan

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.