We have SQL Server 2008 R2 Standard on a Windows Server cluster. I want to defrag all indexes on a database.
What is the best approach to disable all connections and allow the rebuild of indexes?
I might not be able to shutdown web servers. I doubt single user mode would work as my connection might be kicked out. I also doubt restricted user mode would work as the application logs in as dbo.
One solution that comes to mind is disabling the SQL Server port but not quite sure. Any suggestions?
Edit: I think of setting the database as single_user\restricted_user and connect via DAC and run the defrag job from the command line. Do you think this would work?