How to start/stop replication agent for transactional replication via Transact SQL

How to start/stop replication agent for transactional replication via Transact SQL

Post by Greg Livengo » Fri, 10 May 2002 06:54:02



I started trying to figure out how to start and stop the replication
agent for my transactional publication.  What I found that I could do
was the following to stop the agent



WHERE dest_db='myDB' AND artid='1'

  This seems to work, but I wanted to get feedback on the following
questions

1.  Is this an acceptable way to stop the transactional replication
agent?
2.  How can I specify the subscription server along with the dest_db
in my select stmt?
3.  Why is it that when I stop the first article all of the other
published articles stop their replication as well?
a.  Note that I get an error indicating that the job is all ready
stopped if I try to stop the job for my other articles in the same
publication.

Thank you for your help in advance,
--Greg

 
 
 

How to start/stop replication agent for transactional replication via Transact SQL

Post by Hilary Cotte » Fri, 10 May 2002 10:28:51


this is only capturing the very last distribution_jobid in the
syssubscriptions table.

I normally query sysjobs for the job I am looking for using the description
field to locate the job I am looking for and then run sp_stopjob passing
this jobid

> I started trying to figure out how to start and stop the replication
> agent for my transactional publication.  What I found that I could do
> was the following to stop the agent



> WHERE dest_db='myDB' AND artid='1'

>   This seems to work, but I wanted to get feedback on the following
> questions

> 1.  Is this an acceptable way to stop the transactional replication
> agent?
> 2.  How can I specify the subscription server along with the dest_db
> in my select stmt?
> 3.  Why is it that when I stop the first article all of the other
> published articles stop their replication as well?
> a.  Note that I get an error indicating that the job is all ready
> stopped if I try to stop the job for my other articles in the same
> publication.

> Thank you for your help in advance,
> --Greg


 
 
 

How to start/stop replication agent for transactional replication via Transact SQL

Post by George Li [M » Fri, 10 May 2002 22:36:16


It is not recommended to query the system tables directly in this way.
Since the system tables may be modified in the future release.

If you do need to control the replication agents manually, we suggest you
use the replication ActiveX control. You can find detailed information
about how to use these controls in the SQL Server Books Online.

This posting is provided "AS IS" with no warranties, and confers no rights.

Best Regards,

George Li

Microsoft Support

 
 
 

1. Transactional REPLICATION: Distribution agent stops after connection failure ...

Hi

We setup a transactional replication (without immediate update) between sql
7 databases. When the connection between the two sql servers cannot be
established (network cable unplugged during testing), the distribution agent
tries 10 times to reestablish the connection, then the distrinution agent is
stopped. Even when there are new transactions, the agent isn't restarted. Is
there a property that can be set, to restart the agent when there are new
transactions, or to restart the agent after a certain time period.

Thanks Stefan, Rahel

2. Alpha Index for Customer Database

3. SQL Server 7, Transactional Replication, How to enumerate pending replication commands in readible format

4. SQL7: restore MSDB without restoring Master?

5. Stopping Transactional Replication Temporarily Question

6. adNumeric does not work?

7. Transactional Replication failure: License and Log Reader Agent

8. database replication

9. Programmatically Restart Distribution Agent in Transactional Replication

10. Distributor Agent Error using transactional replication

11. Snapshop agent Error in Transactional Replication

12. Transactional Replication and Snapshot agent