Showing posts with label scenario. Show all posts
Showing posts with label scenario. Show all posts

Monday, March 26, 2012

Merge Agent Hangs (reporting no errors)

Hi,
In my merge replication scenario I use Push subscriptions. The
distributor is SQL server 2000 Sp3a, and subscribers are MSDE SP3a.
Everything works fine but recently merge agents started to "hang"
reporting no errors at random phases of replication session. They stop
sending or receiving any data between distributor and subscriber
(there is no network traffic). SQL Profiles show no activity on a
subscriber server. Last message generated by agent is "The process is
running and is waiting for a response from one of the backend
connections".
If there is a problem with communication between servers one would
expect returnig an error code and retrying operation. In my case the
merge agent "hangs" and waits for nothing. After 1 or 2 hours it
reports a communication link failure (waits for a random period of
time).
To continue a Merge process I have to Stop and Start the merge agent
manually.
Since my replication sends a lot of data from subscribers
(MSMerge_genhistory has approx 50000 entries when retention period is
set to 2 days.) after uploading data changes to the publisher (the
procedure sp_MScheckexistsgeneration is executed for every one of
50000 generations - am I right about this?) it takes a long time (40
minutes) to complete. If merge agent hangs, the process must be run
from the beginning. In this situation it is almost impossible to
complete the replication session.
What can be the cause of such behavior of merge agents?
Last lines of output (level 3) generated by agent are as follows:
{call sp_MScheckexistsgeneration (?, ?) }
{call sp_MScheckexistsgeneration (?, ?) }
Percent Complete: 0
The process is running and is waiting for a response from one of the
backend connections.
Repl Agent Status: 3
Tomek
Tomek,
it's difficult to say, but in some sense this looks like a connectivity
issue. However, when I've seen such a situation before, the error was
'General network error'. You might like to verify is this is/is not the
case, by using a Network Monitor tool:
http://support.microsoft.com/default...48942&sd=tech.
Alternatively you could open a window in QA on the publisher, with the
window connected to the subscriber SQL Server. In the window do a simple
select command in a loop and return the date. This should tell you if/when
the connectivity had problems.
Can you check in current activity or sp_who2/sp_lock/sp_blocker to identify
if there is any blocking involved. If the problem is not connectivity then
this would be my next test.
I'd also like to know what happens when you restart the agent - does it work
quickly or still take a long time but is successful.
No doubt you have considered this, but if possible can you synchronize more
often to shorten the batchsize?
You might also optimize performance by running
sp_mergemetadataretentioncleanup manually and optimize
he -DownloadGenerationsPerBatch parameter.
HTH,
Paul Ibison
|||Paul,
Thank you for your response. I hope my answers to your questions will
help us to solve the problem.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message news:<#EzzqyDQEHA.1312@.TK2MSFTNGP12.phx.gbl>...
> it's difficult to say, but in some sense this looks like a connectivity
> issue. However, when I've seen such a situation before, the error was
> 'General network error'. You might like to verify is this is/is not the
> case, by using a Network Monitor tool:
> http://support.microsoft.com/default...48942&sd=tech.
It can be related to connectivity because merge agents connect to
subscribers that not always use reliable network connection. But the
problem is that instead of reporting General network error and
retrying operation agent waits (hangs) doing nothing.

> Alternatively you could open a window in QA on the publisher, with the
> window connected to the subscriber SQL Server. In the window do a simple
> select command in a loop and return the date. This should tell you if/when
> the connectivity had problems.
QA in loop worked fine (no connectivity problems), but in the same
time agent assigned to the same subscriber hanged.

> Can you check in current activity or sp_who2/sp_lock/sp_blocker to identify
> if there is any blocking involved. If the problem is not connectivity then
> this would be my next test.
I've checked this ne too. Blocking is not the reason.

> I'd also like to know what happens when you restart the agent - does it work
> quickly or still take a long time but is successful.
I will describe how my agent works. Please tell me is it correct
behavior.
1) After connecting to subscriber agent uploads all the data changes
made by subscriber to the publisher. This works very fast and i do not
see any problem here (agent has never stopped at this phase).
2) Merge agent executes sp_MScheckexistsgeneration for each of 50000
generations stored in msmerge_genhistory at subscriber side. If there
is some data to download, it is downloaded to subscriber, and then
merge agent checks next generation.
Now let's assume that merge agent "hanged" ot generation 39000. After
restarting the agent it starts the process from the beginning checking
each of 39000 generations that where checked and merged in previus
session.
The merge agent is succesfull only if it is able to go through 50000
generations without loosing connection to subscriber. That is wy it is
so difficult to complete merge session.
IMHO the merge agent should start from generation 39000 making
completing session possible even on not reliable connections. Is it
"by design" behaviour?

> No doubt you have considered this, but if possible can you synchronize more
> often to shorten the batchsize?
It is not possible. subscribers can not synchronize on saturday and
sunday. So 2 days retention perod is minumum.

> You might also optimize performance by running
> sp_mergemetadataretentioncleanup manually and optimize
> he -DownloadGenerationsPerBatch parameter.
I think the problem is not metadata at publisher but metadata at
subscribers. It is not deleted after succesfull replication session (i
think it must work this way).
DownloadGenerationsPerBatch does not help because most of the time
merge agent executes sp_MScheckexistsgeneration without downloading
any data changes. Or maybe I am misunderstanding this parameter?.
Tomek
|||Tomek,
Slow and unreliable connections can result in more retries by the Merge
Agent, none of which you've seen. Your QA test also indicates the same
thing, so we can cross this off the list.
Answers inline...

> IMHO the merge agent should start from generation 39000 making
> completing session possible even on not reliable connections. Is it
> "by design" behaviour?
>
I guess it is not processed this way to try to avoid potential
non-convergence as inserts and child records could be in separate batches
(http://support.microsoft.com/default...b;enus;Q308266)

>
Having MetadataRetentionCleanup 1 should sort this out, but you could run
manually sp_mergemetadataretentioncleanup on the publisher and subscriber to
see if things are improved. It won't remove the 50000 entries, but what I am
hoping is that the search for new generations will be noticeably quicker
after old ones are removed.

> DownloadGenerationsPerBatch does not help because most of the time
> merge agent executes sp_MScheckexistsgeneration without downloading
> any data changes. Or maybe I am misunderstanding this parameter?.
Increasing the -DownloadGenerationsPerBatch Merge Agent parameters (even to
its maximum value of 2000) is a recommendation where a Subscriber has not
merged data with the Publisher for an extended period time, during which the
Publisher or other Subscribers have made numerous changes
(http://www.microsoft.com/technet/pro...n/mergperf.msp
x). So, I'd definitley test altering this parameter's value.
(Powodzenia)
Paul

Friday, March 23, 2012

Merge Agent

Hello,
I have a merge replication scenario where occasionally the
subscription server will go offline for a period of time.
It seems that when this is the case the merge agent stops
and when the subscription server becomes available I have
to manually restart the merge agent for syncronization to
continue. Does this seem right or should the merge agent
continue to run even while the subscription server is
unavailable so that when the subscription server becomes
available syncronization will continue automatically?
Any help would be appreciated!
Thanks in advance.
this behavior is by design. To fix it you should schedule the merge agent to
run every 10 minutes. This way it will continually retry until it succeeds.
You might also want to recreate the subscription as a pull subscription.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"Jerry G." <anonymous@.discussions.microsoft.com> wrote in message
news:1c4e701c45257$6cd0c470$a101280a@.phx.gbl...
> Hello,
> I have a merge replication scenario where occasionally the
> subscription server will go offline for a period of time.
> It seems that when this is the case the merge agent stops
> and when the subscription server becomes available I have
> to manually restart the merge agent for syncronization to
> continue. Does this seem right or should the merge agent
> continue to run even while the subscription server is
> unavailable so that when the subscription server becomes
> available syncronization will continue automatically?
> Any help would be appreciated!
> Thanks in advance.

Merge & Snapshot Clarification

Hope to get a lil info on the settings for this scenario...
i got Table A that sits on different branches, and the data it contains
should be merged with Table A in the HQ. So I've set this to use the Merge
replication.
So to ensure all branches have the same data in Table A, do i have to ensure
that the replication is executed on a "cascading" timeline ? Branch A from
12am-1am , Branch B from 2am - 3am , etc ?
and finally
i got Table B that also sits on different branches, but the data is just to
be appended to Table B in the HQ and the individual branches have their
original Table B intact... What replication do i use for this ? I tried
snapshot , but that copies the entire table over overwriting the HQs table..
i want it to append. 1 way flow of data. How do i achieve this ?
Thanks in advance.
Outgoing mail is certified Virus Free. (well i'd like to think it is.. )
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.712 / Virus Database: 468 - Release Date: 27/06/2004
okie im partly there already...
i found a setting for the snapshot to keep the table intact on the
destination , so now on the snapshot replication it doesnt overwrite the
data but appends like i wanted and the original tables on the branches are
left as is...
coming to the next problem, now with 2 publications (one merge TableA , one
snapshot Table B) the merge doesnt seem to be working.. i keep getting this
error :
"The process could not drop one or more tables because the tables are being
used by other publications.
(Source: Merge Replication Provider (Agent); Error number: -2147200976)"
How do you manage more than 1 publication so that this does not occur ? is
there a certain gap (time) to have between them ? i ran them thru the right
click synchronize option.
"Mike Smith" <test@.test.com> wrote in message
news:O9tssKFaEHA.2296@.TK2MSFTNGP10.phx.gbl...
> Hope to get a lil info on the settings for this scenario...
> i got Table A that sits on different branches, and the data it contains
> should be merged with Table A in the HQ. So I've set this to use the Merge
> replication.
> So to ensure all branches have the same data in Table A, do i have to
ensure
> that the replication is executed on a "cascading" timeline ? Branch A from
> 12am-1am , Branch B from 2am - 3am , etc ?
> and finally
> i got Table B that also sits on different branches, but the data is just
to
> be appended to Table B in the HQ and the individual branches have their
> original Table B intact... What replication do i use for this ? I tried
> snapshot , but that copies the entire table over overwriting the HQs
table..
> i want it to append. 1 way flow of data. How do i achieve this ?
> Thanks in advance.
>
> --
> Outgoing mail is certified Virus Free. (well i'd like to think it is.. )
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.712 / Virus Database: 468 - Release Date: 27/06/2004
>
Outgoing mail is certified Virus Free. (well i'd like to think it is.. )
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.712 / Virus Database: 468 - Release Date: 27/06/2004
|||Mike, it sounds like you are bumping into the same problem as what you have
with the first table/publication.
Can you double click on your merge agent in EM, and see what the name of the
problem table is in the Error Details dialog?
It is table a or table b?
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"Mike Smith" <test@.test.com> wrote in message
news:OmqH3XFaEHA.2516@.TK2MSFTNGP10.phx.gbl...
> okie im partly there already...
> i found a setting for the snapshot to keep the table intact on the
> destination , so now on the snapshot replication it doesnt overwrite the
> data but appends like i wanted and the original tables on the branches are
> left as is...
> coming to the next problem, now with 2 publications (one merge TableA ,
one
> snapshot Table B) the merge doesnt seem to be working.. i keep getting
this
> error :
> "The process could not drop one or more tables because the tables are
being
> used by other publications.
> (Source: Merge Replication Provider (Agent); Error number: -2147200976)"
> How do you manage more than 1 publication so that this does not occur ? is
> there a certain gap (time) to have between them ? i ran them thru the
right[vbcol=seagreen]
> click synchronize option.
>
> "Mike Smith" <test@.test.com> wrote in message
> news:O9tssKFaEHA.2296@.TK2MSFTNGP10.phx.gbl...
Merge[vbcol=seagreen]
> ensure
from
> to
> table..
>
> --
> Outgoing mail is certified Virus Free. (well i'd like to think it is.. )
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.712 / Virus Database: 468 - Release Date: 27/06/2004
>
|||well the error details doesnt say what table , but currently that
publication is set only to 1 table and thats table A itself..
is it a Service pack issue ? saw something somewhere on how this could be a
factor..
This brings me to yet another issue.. im using MSDE to synch with a SQL
SERVER 2000 database on the same machine.
So i installed SP3 for the SQL server 2000 (default instance)
and for the MSDE i installed it via
C:\sql2ksp3MSDE\MSDE\setup.exe /upgradesp sqlrun INSTANCENAME=NETSDK
DISABLENETWORKPROTOCOLS=1 BLANKSAPWD=1
Now my SQL Server Agent wont run .. i get the error "the dependency service
does not exist of marked for deletion" when i try and start the service..
hmmm i got the command line off the readme file in the sp3 cause it was
trying to install it over the default instance... im guessing
DISABLENETWORKPROTOCOLS=1 should not have been there?
"Hilary Cotter" <hilaryk@.att.net> wrote in message
news:ufCuuCNaEHA.1152@.TK2MSFTNGP09.phx.gbl...
> Mike, it sounds like you are bumping into the same problem as what you
have
> with the first table/publication.
> Can you double click on your merge agent in EM, and see what the name of
the[vbcol=seagreen]
> problem table is in the Error Details dialog?
> It is table a or table b?
> --
> Hilary Cotter
> Looking for a book on SQL Server replication?
> http://www.nwsu.com/0974973602.html
>
> "Mike Smith" <test@.test.com> wrote in message
> news:OmqH3XFaEHA.2516@.TK2MSFTNGP10.phx.gbl...
are[vbcol=seagreen]
> one
> this
> being
is[vbcol=seagreen]
> right
contains[vbcol=seagreen]
> Merge
> from
just[vbcol=seagreen]
their[vbcol=seagreen]
tried[vbcol=seagreen]
is.. )
>
well the error details doesnt say what table , but currently that
publication is set only to 1 table and thats table A itself..
is it a Service pack issue ? saw something somewhere on how this could be a
factor..
This brings me to yet another issue.. im using MSDE to synch with a SQL
SERVER 2000 database on the same machine.
So i installed SP3 for the SQL server 2000 (default instance)
and for the MSDE i installed it via
C:\sql2ksp3MSDE\MSDE\setup.exe /upgradesp sqlrun INSTANCENAME=NETSDK
DISABLENETWORKPROTOCOLS=1 BLANKSAPWD=1
Now my SQL Server Agent wont run .. i get the error "the dependency service
does not exist of marked for deletion" when i try and start the service..
hmmm i got the command line off the readme file in the sp3 cause it was
trying to install it over the default instance... im guessing
DISABLENETWORKPROTOCOLS=1 should not have been there?
"Hilary Cotter" <hilaryk@.att.net> wrote in message
news:ufCuuCNaEHA.1152@.TK2MSFTNGP09.phx.gbl...
> Mike, it sounds like you are bumping into the same problem as what you
have
> with the first table/publication.
> Can you double click on your merge agent in EM, and see what the name of
the[vbcol=seagreen]
> problem table is in the Error Details dialog?
> It is table a or table b?
> --
> Hilary Cotter
> Looking for a book on SQL Server replication?
> http://www.nwsu.com/0974973602.html
>
> "Mike Smith" <test@.test.com> wrote in message
> news:OmqH3XFaEHA.2516@.TK2MSFTNGP10.phx.gbl...
are[vbcol=seagreen]
> one
> this
> being
is[vbcol=seagreen]
> right
contains[vbcol=seagreen]
> Merge
> from
just[vbcol=seagreen]
their[vbcol=seagreen]
tried[vbcol=seagreen]
is.. )
>

Monday, March 19, 2012

Memory usage SQL Server 2000

Hi,
We have a scenario wherein RAM usage is creeping up until the DB has to be restarted (SQL server 2000 no service packs). There are 15 concurrent users connecting via ODBC (TCP/IP).
Please can anyone give any tips as to how we can track down the problem?
Thanks.We are also having the same problem on a couple of our MSSQL Server 2000 machines. All help in this would be greatly appreciated.
Sam|||You need to have a server with the following configuration:
It must include Backup Drive PV110T DLT1 40/80GB INTERNAL
and also the server preferrably must contain the following:
PowerEdge 6400 PIII Xeon 700MHz/2MB
2 x Terminator Card PE64x0
Add. CPU PIII Xeon 700MHz/2MB
2GB (4*512) 133MHz SDRAM
48x IDE CD-ROM
PERC3/DC 128MB RAID, U160 SCSI
4 x 36GB SCSI HDD, 15K RPM, 80-pin
Embedded Intel Pro 100+ PCI Ethernet NIC
and other ordinary devices.

You must have a very excellent RAM Capacity as mentioned above to avoid the slow performance of your service and to allow all users maintain their own work without any complaints.

Wish you good luck.