Thursday, March 29, 2012
Error replication agent is not registered properly
several months now. his morning we are seeing these errors in the LOG and
QUEUE READER logs.
You Receive Error Message: "The replication agent is not registered
properly. Rerun SQL Server setup.
Any ideas?
SQL Server 2000 SP3
Running the following command would likely resolve the issue:
"%ProgramFiles%\Microsoft SQL Server\80\COM\qrdrsvc.exe" -RegServer
Although I am curious to know if you have installed\uninstalled software
recently on the box that might have caused the problem in the first place.
-Raymond
"CAP" <abraxas1969@.hotmail.com> wrote in message
news:ehtb84P$FHA.740@.TK2MSFTNGP12.phx.gbl...
> We've been running transactional replication with updatable subscribers
> for
> several months now. his morning we are seeing these errors in the LOG and
> QUEUE READER logs.
>
> You Receive Error Message: "The replication agent is not registered
> properly. Rerun SQL Server setup.
>
> Any ideas?
> SQL Server 2000 SP3
>
|||Appreciate the info !
We are investigating if changes to either the OS or SQLServer itself are the
root cause of this problem. We are seeing that in addition to the queue
reader agent, these are also experiencing the same errors:
LOG READER agent
SNAPSHOT agent
DISTRIBUTION agent.
Does this means we also need to run the command below to register the above
agents as well or just 'qrdrsvc.exe' as you indicate?
==============
"Raymond Mak [MSFT]" <rmak@.online.microsoft.com> wrote in message
news:O2nEgfS$FHA.140@.TK2MSFTNGP12.phx.gbl...
> Running the following command would likely resolve the issue:
> "%ProgramFiles%\Microsoft SQL Server\80\COM\qrdrsvc.exe" -RegServer
> Although I am curious to know if you have installed\uninstalled software
> recently on the box that might have caused the problem in the first place.
> -Raymond
> "CAP" <abraxas1969@.hotmail.com> wrote in message
> news:ehtb84P$FHA.740@.TK2MSFTNGP12.phx.gbl...
>
|||This seems really strange, is this a clustered SQL Server instance or was
there a registry restore\repair on the box?
In any case, you can probably resolve the issue that you are seeing by
running the agent executables with the -RegServer parameter:
Snapshot agent - snapshot.exe
Logreader agent - logread.exe
Distribution agent - distrib.exe
If the problem is as extensive as it seems to be you may also need to
re-register the support dlls for the replication agents using regsvr32.exe.
Here is a list off the top of my head:
rinitcom.dll
repldp.dll
rdistcom.dll
-Raymond
"GuayacanSQL" <abraxas1969@.hotmail.com> wrote in message
news:eDajBto$FHA.3864@.TK2MSFTNGP12.phx.gbl...
> Appreciate the info !
>
> We are investigating if changes to either the OS or SQLServer itself are
> the root cause of this problem. We are seeing that in addition to the
> queue reader agent, these are also experiencing the same errors:
>
> LOG READER agent
> SNAPSHOT agent
> DISTRIBUTION agent.
>
> Does this means we also need to run the command below to register the
> above agents as well or just 'qrdrsvc.exe' as you indicate?
>
> ==============
> "Raymond Mak [MSFT]" <rmak@.online.microsoft.com> wrote in message
> news:O2nEgfS$FHA.140@.TK2MSFTNGP12.phx.gbl...
>
|||This is a 2-node clustered SQLServer environment. Word were are getting is
that an attempt to install a new named instance on the cluster failed
(reason unknown) and had to be uninstalled. We are seeing these errors right
after this happened.
"Raymond Mak [MSFT]" <rmak@.online.microsoft.com> wrote in message
news:%23wyI2D0$FHA.2736@.TK2MSFTNGP11.phx.gbl...
> This seems really strange, is this a clustered SQL Server instance or was
> there a registry restore\repair on the box?
> In any case, you can probably resolve the issue that you are seeing by
> running the agent executables with the -RegServer parameter:
> Snapshot agent - snapshot.exe
> Logreader agent - logread.exe
> Distribution agent - distrib.exe
> If the problem is as extensive as it seems to be you may also need to
> re-register the support dlls for the replication agents using
regsvr32.exe.[vbcol=seagreen]
> Here is a list off the top of my head:
> rinitcom.dll
> repldp.dll
> rdistcom.dll
> -Raymond
> "GuayacanSQL" <abraxas1969@.hotmail.com> wrote in message
> news:eDajBto$FHA.3864@.TK2MSFTNGP12.phx.gbl...
software[vbcol=seagreen]
subscribers
>
|||It was determined that uninstalling one of the SQL instances on the cluster
caused the replication agents to be unregistered. We executed the commands
below and all went well with the exception of the QUEUE READER agent. When
we attempt to register the queue reader agent with 'qrdrsvc.exe regserver'
we get this error:
===================
Microsoft SQL Server Replication Queue Reader Agent 8.00.760 Copyright (c)
2000 Microsoft Corporation
Server: SERVER1, Database distribution : ODBC Error:SQL Server does not
exist or access denied.
Unable to connect to Local Distributor
Queue Reader aborting
=======================
Is there something special about registering queue reader agent ?
"CAP" <abraxas1969@.hotmail.com> wrote in message
news:OcDiKc0$FHA.140@.TK2MSFTNGP12.phx.gbl...
> This is a 2-node clustered SQLServer environment. Word were are getting is
> that an attempt to install a new named instance on the cluster failed
> (reason unknown) and had to be uninstalled. We are seeing these errors
right[vbcol=seagreen]
> after this happened.
>
> "Raymond Mak [MSFT]" <rmak@.online.microsoft.com> wrote in message
> news:%23wyI2D0$FHA.2736@.TK2MSFTNGP11.phx.gbl...
was[vbcol=seagreen]
> regsvr32.exe.
are[vbcol=seagreen]
> software
> subscribers
LOG
>
|||That seems kind of strange as I didn't get any messages when I tried the
same on my machine. But if you can start the queue reader agent from
SEM\SQLServerAgent then I wouldn't worry too much about it.
-Raymond
"CAP" <abraxas1969@.hotmail.com> wrote in message
news:eLNoFckAGHA.1312@.TK2MSFTNGP09.phx.gbl...
> It was determined that uninstalling one of the SQL instances on the
> cluster
> caused the replication agents to be unregistered. We executed the commands
> below and all went well with the exception of the QUEUE READER agent.
> When
> we attempt to register the queue reader agent with
> 'qrdrsvc.exe -regserver'
> we get this error:
> ===================
> Microsoft SQL Server Replication Queue Reader Agent 8.00.760 Copyright (c)
> 2000 Microsoft Corporation
> Server: SERVER1, Database distribution : ODBC Error:SQL Server does not
> exist or access denied.
> Unable to connect to Local Distributor
> Queue Reader aborting
> =======================
> Is there something special about registering queue reader agent ?
>
> "CAP" <abraxas1969@.hotmail.com> wrote in message
> news:OcDiKc0$FHA.140@.TK2MSFTNGP12.phx.gbl...
> right
> was
> are
> LOG
>
|||I'm sorry. Can you please elaborate more on what you mean with
SEM\SQLServerAgent ? We are trying to start the queue reader agent from
Enterprise Manager and keep getting the error:
"The replication agent is not registered properly. Rerun SQL Server setup"
===================
"Raymond Mak [MSFT]" <rmak@.online.microsoft.com> wrote in message
news:OdN0KTmAGHA.204@.TK2MSFTNGP15.phx.gbl...[vbcol=seagreen]
> That seems kind of strange as I didn't get any messages when I tried the
> same on my machine. But if you can start the queue reader agent from
> SEM\SQLServerAgent then I wouldn't worry too much about it.
> -Raymond
> "CAP" <abraxas1969@.hotmail.com> wrote in message
> news:eLNoFckAGHA.1312@.TK2MSFTNGP09.phx.gbl...
commands[vbcol=seagreen]
(c)[vbcol=seagreen]
by[vbcol=seagreen]
to[vbcol=seagreen]
itself[vbcol=seagreen]
the[vbcol=seagreen]
the[vbcol=seagreen]
Server\80\COM\qrdrsvc.exe" -RegServer[vbcol=seagreen]
first[vbcol=seagreen]
registered
>
|||Hi Mark,
When a replication agent is started through a SQL Server Agent job (which is
the same as starting a replication agent from SEM), SQL Server Agent will
activate the replication agent as a COM exe server rather than running it as
a regular executable. That is why I suspect that the COM registration
information for the replication agents was broken when you first reported
the problem. Now from what you have described, your SQL Server installation
was broken due to a clustered instance uninstall so a better course of
action is probably for you to reinstall SQL server rather than trying to fix
bits and pieces of it since nobody knows exactly what pieces are broken.
That said, it is still strange that running 'qrdrsvc.exe -regserver' didn't
return without errors for you (you would want to make sure that Word didn't
mangle the - for you...).
-Raymond
"CAP" <abraxas1969@.hotmail.com> wrote in message
news:u4%234FonAGHA.3872@.TK2MSFTNGP12.phx.gbl...
> I'm sorry. Can you please elaborate more on what you mean with
> SEM\SQLServerAgent ? We are trying to start the queue reader agent from
> Enterprise Manager and keep getting the error:
> "The replication agent is not registered properly. Rerun SQL Server setup"
> ===================
> "Raymond Mak [MSFT]" <rmak@.online.microsoft.com> wrote in message
> news:OdN0KTmAGHA.204@.TK2MSFTNGP15.phx.gbl...
> commands
> (c)
> by
> to
> itself
> the
> the
> Server\80\COM\qrdrsvc.exe" -RegServer
> first
> registered
>
|||In fact, this is what we are getting when running 'qrdrsvc.exe -regserver'
as a server administrator (with System Administrator role on the SQL server)
Microsoft SQL Server Replication Queue Reader Agent 8.00.760 Copyright (c)
2000 Microsoft Corporation
Server: SERVER1, Database distribution : ODBC Error:SQL Server does not
exist or access denied.
Unable to connect to Local Distributor
Queue Reader aborting
The process finished. Use CTRL+C to close this window.
=========================
"Raymond Mak [MSFT]" <rmak@.online.microsoft.com> wrote in message
news:%23USLY0nAGHA.516@.TK2MSFTNGP15.phx.gbl...
> Hi Mark,
> When a replication agent is started through a SQL Server Agent job (which
is
> the same as starting a replication agent from SEM), SQL Server Agent will
> activate the replication agent as a COM exe server rather than running it
as
> a regular executable. That is why I suspect that the COM registration
> information for the replication agents was broken when you first reported
> the problem. Now from what you have described, your SQL Server
installation
> was broken due to a clustered instance uninstall so a better course of
> action is probably for you to reinstall SQL server rather than trying to
fix
> bits and pieces of it since nobody knows exactly what pieces are broken.
> That said, it is still strange that running 'qrdrsvc.exe -regserver'
didn't
> return without errors for you (you would want to make sure that Word
didn't[vbcol=seagreen]
> mangle the - for you...).
> -Raymond
> "CAP" <abraxas1969@.hotmail.com> wrote in message
> news:u4%234FonAGHA.3872@.TK2MSFTNGP12.phx.gbl...
setup"[vbcol=seagreen]
the[vbcol=seagreen]
Copyright[vbcol=seagreen]
not[vbcol=seagreen]
failed[vbcol=seagreen]
errors[vbcol=seagreen]
seeing[vbcol=seagreen]
need[vbcol=seagreen]
to[vbcol=seagreen]
register[vbcol=seagreen]
message
>
Friday, March 23, 2012
Error on Update, but not when using cursor
I've implemented a UDF in SQL Server 2005 written in C#. The function with its assembly has been registered ok with SQL Server and works fine. It accepts three short strings (nvarchar of lengths 5, 35, and 35) and returns a SQL formatted string (SqlString).
When I run the function to test it it works just fine, and the same is true if I run the function inside a cursor to update a field in a table. But when I do a simple update it crashes. I've so far received two different errors: first one error saying a string could not be converted into an integer (but the error does not occur when I enter the same input values manually via a test Windows form, or through the new Query Analyzer as a single query - or using it inside a cursor). Then one error saying a string was too short (I couldn't use substring(X, Y) because the string, I was told, was too short - it wasn't).
The problem thus cannot be with the function since it works just fine if I do like this:
UPDATE myTable SET CodeField = dbo.fnMyFunction(Field1, Field2, Field3) WHERE PersonId = 10000001
And it works fine while doing the same thing inside a cursor (for instance working with the first 10, 100 or 1000 records).
But when I do this it crashes:
UPDATE myTable SET CodeField = dbo.fnMyFunction(Field1, Field2, Field3)
For your information the table has about 1.5M records (for testing, it contain more data when on the production server) and my aim is to update the CodeField column as quickly as possible. The CodeField is a 12-character string that is based on a rather complex algorithm including the Field1, Field2 and Field3 strings. I'm using C# because it manages strings much better than SQL Server - and it is so much easier coding this stuff.
Anyhow, I've had this kind of problem before with SQL Servers 2000 and 7 (maybe even 6.5) and it seems the problem occurs when I let SQL Server go about its business at its own pace. But when I do something to control that it really takes one record at a time (through using a cursor or executing the query with a WHERE clause like the one above) it works splendidly.
The problem here is that a cursor is way too slow, and there really shouldn't be a problem with a simple UPDATE command, should it? After all, everything works just fine except when I let SQL Server do what it does best (i.e. update the field at its own speed, whatever that is).
Any ideas? This is very frustrating since it is impossible to try and find the error - it isn't there when testing! And it is frustrating since I remember having had the same kind of problem (but every time with different errors arising) before without finding a solution (except for slowing everything down - not an option here).
Is there a certain tweak I can do to make things work out, or should I code things differently?
Thanks!
Hi BylundYour update statement will fail because it does not know which records you are trying to update.
Am I correct in thinking you want to update ALL records in the DB?
It seems to me, despite your function, you still need to provide some sort of where clause.
Let me know so I can help further.
Barry Andrew (Pace)sql
Error on Update, but not when using cursor
I've implemented a UDF in SQL Server 2005 written in C#. The function with its assembly has been registered ok with SQL Server and works fine. It accepts three short strings (nvarchar of lengths 5, 35, and 35) and returns a SQL formatted string (SqlString).
When I run the function to test it it works just fine, and the same is true if I run the function inside a cursor to update a field in a table. But when I do a simple update it crashes. I've so far received two different errors: first one error saying a string could not be converted into an integer (but the error does not occur when I enter the same input values manually via a test Windows form, or through the new Query Analyzer as a single query - or using it inside a cursor). Then one error saying a string was too short (I couldn't use substring(X, Y) because the string, I was told, was too short - it wasn't).
The problem thus cannot be with the function since it works just fine if I do like this:
UPDATE myTable SET CodeField = dbo.fnMyFunction(Field1, Field2, Field3) WHERE PersonId = 10000001
And it works fine while doing the same thing inside a cursor (for instance working with the first 10, 100 or 1000 records).
But when I do this it crashes:
UPDATE myTable SET CodeField = dbo.fnMyFunction(Field1, Field2, Field3)
For your information the table has about 1.5M records (for testing, it contain more data when on the production server) and my aim is to update the CodeField column as quickly as possible. The CodeField is a 12-character string that is based on a rather complex algorithm including the Field1, Field2 and Field3 strings. I'm using C# because it manages strings much better than SQL Server - and it is so much easier coding this stuff.
Anyhow, I've had this kind of problem before with SQL Servers 2000 and 7 (maybe even 6.5) and it seems the problem occurs when I let SQL Server go about its business at its own pace. But when I do something to control that it really takes one record at a time (through using a cursor or executing the query with a WHERE clause like the one above) it works splendidly.
The problem here is that a cursor is way too slow, and there really shouldn't be a problem with a simple UPDATE command, should it? After all, everything works just fine except when I let SQL Server do what it does best (i.e. update the field at its own speed, whatever that is).
Any ideas? This is very frustrating since it is impossible to try and find the error - it isn't there when testing! And it is frustrating since I remember having had the same kind of problem (but every time with different errors arising) before without finding a solution (except for slowing everything down - not an option here).
Is there a certain tweak I can do to make things work out, or should I code things differently?
Thanks!
Hi BylundYour update statement will fail because it does not know which records you are trying to update.
Am I correct in thinking you want to update ALL records in the DB?
It seems to me, despite your function, you still need to provide some sort of where clause.
Let me know so I can help further.
Barry Andrew (Pace)