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.
Author |
Topic |
vietcave
Starting Member
11 Posts |
Posted - 2005-05-31 : 02:31:44
|
Hi, everyoneI 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 casei 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... |
 |
|
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. |
 |
|
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_jobsysprocesses - to check if the distribution agent is runningsp_start_job - to start the jobremember 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... |
 |
|
vietcave
Starting Member
11 Posts |
Posted - 2005-05-31 : 04:09:03
|
Thank, I will try |
 |
|
|
|
|
|
|