1

I have an archival job in my SQL Server which is part of AOAG. I can see the same job in all replicas which are part of AOAG and it's scheduled at the same time.

It is running at the same time on all servers for around 30 seconds successfully.

Can anyone let me know the logic behind the same job same schedule in all replicas successfully running.

It is connecting through AOAG listener to servers and the first step will be copying a file to another location and running the archival job, on job success the source location will be deleted. This is what I can see in job properties-->steps.

I need to create a new customized archival job.

  • What will be the problem if I create the job with 5 minutes difference in each replica?

  • Will there be any problem if I schedule this job at same time in each replica?

Please advise.

1 Answer 1

3

They are meant to do a check on each node to see whether it's the primary or not before continuing to run the rest of the logic but they didn't bother.

It sounds like someone set it up under the belief that it will never interfere with each other concurrently (maybe because it has file locks or something else).

No biggie. If you're redesigning it I would add the primary replica check anyway. The question about 30s to 5m is impossible to say though. It's not going to break the AG but what it does to the software is another question.

1
  • Thanks @Cody,it helped and cleared my doubts to an extent. Commented Aug 26, 2016 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.