We have a very busy DB in a SQL cluster at the moment, that I am moving to a 2012 AG. Every night, there is a job that moves data around into a bunch of newly created tables. In the cluster, the job uses single user mode to pause incoming data while it makes the changes:
SET SINGLE_USER WITH ROLLBACK AFTER 10 SECONDS
So I've been looking around, but I'm not a heavy DBA, so I haven't been able to find an alternative for this command in the job. Right now, the job fails every day. It cannot make the necessary changes while data is still flowing into the DB. How can I pause the incoming data until the job finishes? Is there a way to take the listener offline temporarily or some other way to make this work?
Thanks!!