I'm not an expert on SQL, but have to rebuild index and update statistics on a database.
When I search the steps to do, nearly all of them are running manual codes to do it and they are all different.
So, I created a SMSS maintenance plan to do the rebuild index and update statistics. And I will run it on the scheduled maintenance time this Friday. It will probably take a lot of time since I haven't done it for a few years. The reason why it is, because when I run it, it fails. I think it's because users access database. I have to block all connections to SQL server.
1.How to block all SQL connections so that I can do rebuild index and update statistics alone? I have to do this at midnight from home, and can't disconnect network connection, have to block only SQL connections and stay offline.
2.I see an option in the SQL maintenance job I created, but not sure this is the only option I can do.
3.Can I take the database offline by 'SSMS / Tasks/ Take Offline' and rebuild index?
The server is Windows 2012 STD and SQL 2008 STD