Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Replication die when Subscriber shutdown

Author  Topic 

vietcave
Starting Member

11 Posts

Posted - 2005-05-31 : 02:31:44
Hi, everyone
I have a problem. Please help me.
I use Transactional replication mode. First, I configure Publisher and Distributor in the same server COMPUTER01. Then I use another server COMPUTER02 as Subscriber. I create a publication and push it from COMPUTER01 to COMPUTER02. Everything works well.
Now, I turn off both COMPUTER01 and COMPUTER02. Then I turn on only COMPUTER01 (Publisher and Distributor). After 30 minutes, I find out that in Replication Monitor of COMPUTER01 there is an error "The process could not connect to COMPUTER02". Now I turn on COMPUTER02. The error still exists. I have to right click Distribution Agent in COMPUTER01 and select "Start Agent". Everything comes back.
I wonder if there is a way that automatically does replication without selecting "Start Agent" when COMPUTER02 is turned on.
Please help me.
Thanks

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-05-31 : 02:45:56
create a job, that will run the distribution agent if it's in stop status, schedule this on whatever time is most likely for your case

i have one job that does this every morning before everything gets replicated, so whether or not i checked the status of the agent, replication gets started every morning if it's stopped

--------------------
keeping it simple...
Go to Top of Page

vietcave
Starting Member

11 Posts

Posted - 2005-05-31 : 03:23:06
Thank you very much.
Could you give me the code of the job that checks the status of Distribution Agent and starts it if it stops?
Thanks.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-05-31 : 03:45:42
explore:

sysjobs - to retrieve the job id or name to be passed to sp_start_job
sysprocesses - to check if the distribution agent is running
sp_start_job - to start the job

remember that the distribution agent/job for transactional replication is always executing unless it is stopped, so querying through sysprocesses will give you on it's status, if it's not there, start the job



--------------------
keeping it simple...
Go to Top of Page

vietcave
Starting Member

11 Posts

Posted - 2005-05-31 : 04:09:03
Thank, I will try
Go to Top of Page
   

- Advertisement -