Showing posts with label distribution. Show all posts
Showing posts with label distribution. Show all posts

Friday, March 9, 2012

Monitoring & Starting Distribution Agent thru program

Do any one know how to detect a distribution agent failure thru program. Is
there any way to start it programmatically.
Any help would be great
Kumaresh,
how are you setting off the distribution agent? If it is through programming
the activeX control, you could then have a look at the replication errors
collection. This example applies to merge, but AFAIK it's much the same for
transactional.
http://www.windowsitpro.com/Files/09...Listing_01.txt
Alternatively you could look at MSdistribution_history and MSrepl_errors
tables (or the job's history directly)
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks for your valuable comments.
I have set the replication through the SQL Server Enterprise Manager.
But the client complains that they saw the replication failure only after
one day.
And then after they had to set the replication again.
Hence i thought of running a schedular program which checks for replication
and start it if it had a failure.
I also will be very happy if u could suggest or post some guide lines to
proceed
thanks once again
"Paul Ibison" wrote:

> Kumaresh,
> how are you setting off the distribution agent? If it is through programming
> the activeX control, you could then have a look at the replication errors
> collection. This example applies to merge, but AFAIK it's much the same for
> transactional.
> http://www.windowsitpro.com/Files/09...Listing_01.txt
> Alternatively you could look at MSdistribution_history and MSrepl_errors
> tables (or the job's history directly)
> HTH,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
|||Kumaresh,
to let the client know, you could use the alert: 'Replication: agent
failure' and have an email sent from there.
Actually, what I do is send notification directly from the replication job
belonging to the distribution agent with a specific message - in my case I
only have SMTP, so I use an additional step in the distribution agent's job
which is reached only on failure of the main step but if you have MAPI
integrated, then you can just add the On Failure notification like in any
other job. HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks Paul, That was very near to the solution expected.
But i also wanted to know is there any way by which i can handle it by myself,
leaving the client undisturbed. Say for example running a scheduled program
or some thing similar to that. so that i start the relpication without the
intervention of the client
Any suggestions would be great
"Paul Ibison" wrote:

> Kumaresh,
> to let the client know, you could use the alert: 'Replication: agent
> failure' and have an email sent from there.
> Actually, what I do is send notification directly from the replication job
> belonging to the distribution agent with a specific message - in my case I
> only have SMTP, so I use an additional step in the distribution agent's job
> which is reached only on failure of the main step but if you have MAPI
> integrated, then you can just add the On Failure notification like in any
> other job. HTH,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
>
|||Kumaresh,
this will give you any replication errors in the last 24 hours for a
specific replication job. It hope it's OK for your purposes.
SELECT DISTINCT
MSdistribution_agents.name,
MSdistribution_history.runstatus, MSdistribution_history.error_id,
MSdistribution_history.start_time,
MSdistribution_history.comments
FROM MSdistribution_agents INNER JOIN
MSdistribution_history ON MSdistribution_agents.id =
MSdistribution_history.agent_id INNER JOIN
MSrepl_errors ON MSdistribution_history.error_id =
MSrepl_errors.id
WHERE (MSdistribution_agents.name =
N'PC-TEMPLATE-Northwind-PC-TEMPLATE-2') AND
(MSdistribution_history.start_time BETWEEN DATEADD(dd, - 1, GETDATE()) AND
GETDATE())
Rgds,
Paul Ibison
|||Thanks Plan
Here is the way am proceeding. First am gonna write a trigger on
MSdistribution_history table to check for errors
If any error occurs, then a COM object is called to delete MSREPL7 table
created in oracle database
Is this a reliable solution to proceed with.
Also how can a distribution agent be restarted within a trigger
Any help would be great
"Paul Ibison" wrote:

> Kumaresh,
> this will give you any replication errors in the last 24 hours for a
> specific replication job. It hope it's OK for your purposes.
> SELECT DISTINCT
> MSdistribution_agents.name,
> MSdistribution_history.runstatus, MSdistribution_history.error_id,
> MSdistribution_history.start_time,
> MSdistribution_history.comments
> FROM MSdistribution_agents INNER JOIN
> MSdistribution_history ON MSdistribution_agents.id =
> MSdistribution_history.agent_id INNER JOIN
> MSrepl_errors ON MSdistribution_history.error_id =
> MSrepl_errors.id
> WHERE (MSdistribution_agents.name =
> N'PC-TEMPLATE-Northwind-PC-TEMPLATE-2') AND
> (MSdistribution_history.start_time BETWEEN DATEADD(dd, - 1, GETDATE()) AND
> GETDATE())
> Rgds,
> Paul Ibison
>
>
|||Sorry I mean to type "Thanks Paul" but mistyped
[vbcol=seagreen]
> Thanks Plan
> Here is the way am proceeding. First am gonna write a trigger on
> MSdistribution_history table to check for errors
> If any error occurs, then a COM object is called to delete MSREPL7 table
> created in oracle database
> Is this a reliable solution to proceed with.
> Also how can a distribution agent be restarted within a trigger
> Any help would be great
>
> "Paul Ibison" wrote:
|||Kumaresh,
you won't be able to make a trigger on this system table, but you could
schedule a job to run once a minute to poll the table.
Rgds,
Paul Ibison
|||Thanks paul,
I also want to know if i could start the replication from T-Sql
Any reference articles would be very helpful
"Paul Ibison" wrote:

> Kumaresh,
> you won't be able to make a trigger on this system table, but you could
> schedule a job to run once a minute to poll the table.
> Rgds,
> Paul Ibison
>
>
>

Wednesday, March 7, 2012

Monitor show distribution agent that was removed.

While setting up transaction replication from 7 to 2000 I generate a push
subscription that failed to copy the initial schema over. I deleted the
subscription that had caused the problem and started another, that finished
okay and is replicating now. However in the Replication
Monitor-Publishers-servername-publicationname I have the failed agent from
the initial subscription and can not remove it. The same thing applies to
the Replication Monitor-Agents-Distribution Agents. It just won't go away.
SQL7 is the publisher and distributor as well as pushing a subscription to
the SQL2000 box.
Ant help would be appreciated.
Hi Charles,
From your descriptions, I understood that you would like to delete failed
agent but failed to do so. Have I understood you? If there is anything I
misunderstood, please feel free to let me know
Based on my knowledge, when you try to delete them, what's the error
message that shows you are denied to do so? More detailed information will
get us closer to the resolutions.
Secondly, I would like to strongly recommand you the following document,
which show you how to remove a replication manually
How to manually remove a replication in SQL Server 2000
http://support.microsoft.com/?id=324401
Hope this helps, if you have any questions or concerns, don't hesitate to
let me know. We are here to be of assistance!
Sincerely yours,
Mingqing Cheng
Microsoft Online Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!
|||Mingqing,
I can't delete the failed subscription because it does not appear in the
list when I look in the list of subscriptions, the only place that it
appears is in the Monitor. There no way to delete it as far as I know other
than from with in the Publication Properties-Subscriptions and it does not
appear there. The current work subscription is there.
Charlie
""Mingqing Cheng [MSFT]"" <v-mingqc@.online.microsoft.com> wrote in message
news:uLj4km2TEHA.2436@.cpmsftngxa10.phx.gbl...
> Hi Charles,
> From your descriptions, I understood that you would like to delete failed
> agent but failed to do so. Have I understood you? If there is anything I
> misunderstood, please feel free to let me know
> Based on my knowledge, when you try to delete them, what's the error
> message that shows you are denied to do so? More detailed information will
> get us closer to the resolutions.
> Secondly, I would like to strongly recommand you the following document,
> which show you how to remove a replication manually
> How to manually remove a replication in SQL Server 2000
> http://support.microsoft.com/?id=324401
> Hope this helps, if you have any questions or concerns, don't hesitate to
> let me know. We are here to be of assistance!
> Sincerely yours,
> Mingqing Cheng
> Microsoft Online Support
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
> Please reply to newsgroups only, many thanks!
>
>
|||Hi Charlie,
Thanks for your prompt updates!
Based on my knowledge, the list of Agents being displayed in Replication
Monitor are stored in the Tempdb database in the MSreplication_agent_status
table. You could removing a "left over" agent from this table will delete
it from Replication Monitor listing. You can delete any Agent from this
table without causing problems to Replication.
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are here to be of assistance!
Sincerely yours,
Mingqing Cheng
Microsoft Developer Community Support
Introduction to Yukon! - http://www.microsoft.com/sql/yukon
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!
|||Mingqing,
Thanks for your reply. But it looks like it cleared it's self up over the
weekend.
Charles Deaton
""Mingqing Cheng [MSFT]"" <v-mingqc@.online.microsoft.com> wrote in message
news:W%2345a5fUEHA.432@.cpmsftngxa10.phx.gbl...
> Hi Charlie,
> Thanks for your prompt updates!
> Based on my knowledge, the list of Agents being displayed in Replication
> Monitor are stored in the Tempdb database in the
MSreplication_agent_status
> table. You could removing a "left over" agent from this table will delete
> it from Replication Monitor listing. You can delete any Agent from this
> table without causing problems to Replication.
> Thank you for your patience and cooperation. If you have any questions or
> concerns, don't hesitate to let me know. We are here to be of assistance!
>
> Sincerely yours,
> Mingqing Cheng
> Microsoft Developer Community Support
> Introduction to Yukon! - http://www.microsoft.com/sql/yukon
> This posting is provided "as is" with no warranties and confers no rights.
> Please reply to newsgroups only, many thanks!
>