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.
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.