Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Trigger distribution job on completion of snapshot job


Trigger distribution job on completion of snapshot job

Author
Message
asir83
asir83
Grasshopper
Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)

Group: General Forum Members
Points: 24 Visits: 211
Since 30-Aug, the snapshot agent is running for more than 15mins, the interval between the snapshot & subscriber job is 15mins, time increase could possibly due to increase in data, I saw the snapshot size was near to 7 gigs which usually remained between 5-6 gigs on an average.

Since the Snapshot job didn't complete before the subscriber job started, it didn't find a complete snapshot & failed to replicate the data & became inactive.

I can very well increase the time between both the jobs, but that will just be a temp workaround.

I wanted to check how can this situation be handled. Can a triggers be set that can trigger the distribution job as soon as the snapshot jobs completes.

Apprently, i don't have any working knowledge with triggers, apprecaite if you could provide me with a script or something that I can use to make the Distribution job dependent on Snapshot.

This has become a pain for me, please give me a permanent solution.

Thanks
Asir
Divine Flame
Divine Flame
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1567 Visits: 2800
asir83 (9/3/2012)
Since 30-Aug, the snapshot agent is running for more than 15mins, the interval between the snapshot & subscriber job is 15mins, time increase could possibly due to increase in data, I saw the snapshot size was near to 7 gigs which usually remained between 5-6 gigs on an average.

Since the Snapshot job didn't complete before the subscriber job started, it didn't find a complete snapshot & failed to replicate the data & became inactive.

I can very well increase the time between both the jobs, but that will just be a temp workaround.

I wanted to check how can this situation be handled. Can a triggers be set that can trigger the distribution job as soon as the snapshot jobs completes.

Apprently, i don't have any working knowledge with triggers, apprecaite if you could provide me with a script or something that I can use to make the Distribution job dependent on Snapshot.

This has become a pain for me, please give me a permanent solution.

Thanks
Asir



You can use system stored procedure sp_start_job to start the subscriber job after the snapshot agent has completed. It can be done as :

1. Add a new step of type "Transact-SQL Script" in the Snapshot Agent Job
2. This new step should be the last step to execute after all previous steps have successfully executed
3. Write below command in this step:



EXECUTE msdb.dbo.sp_start_job @job_name='PutSubscriberJobNameHere'




Once this has been configured you can disable the schedule of the subscriber job so that it only runs after snapshot job has completed.


Sujeet Singh
asir83
asir83
Grasshopper
Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)

Group: General Forum Members
Points: 24 Visits: 211
U da Man...... Smile

Bet this is what I was looking for, let me try this...Thanks a lot Buddy, apprecaite ur prompt reply.
asir83
asir83
Grasshopper
Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)

Group: General Forum Members
Points: 24 Visits: 211
Hey,
I have one more question, what if the subscriber is a pull subscription & the job is created on different instance?

How can we call the subscriber job remotely?


Thanks
Asir
Divine Flame
Divine Flame
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1567 Visits: 2800
asir83 (9/4/2012)
Hey,
I have one more question, what if the subscriber is a pull subscription & the job is created on different instance?

How can we call the subscriber job remotely?


Thanks
Asir


I think above said stored procedure can be executed via a linked server also. Link servers are not very good when it comes to performance but in this particular case they may be useful.


Sujeet Singh
asir83
asir83
Grasshopper
Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)

Group: General Forum Members
Points: 24 Visits: 211
I see, in that case I have to provide access to MSDB, while creating Linked server.

But thanks for your suggestion, that should work as far as I see.

Thanks Man
durai nagarajan
durai nagarajan
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1107 Visits: 2771
do have your servers running on different id's?.

if it is same id why access change is required?

Regards
Durai Nagarajan
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search