Maintenance on SQL 2012 - Do you have to take databases offline for mainenance
Maintenance on SQL 2012 - Do you have to take databases offline for mainenance
(OP)
I have never taken our production databases offline to do weekly maintenance as it occurs when no one is using the applciations that access the databases and all the maintenance runs without issues. I'm now being questioned why they are not all taken offline to perform the maintenance. I run the DBCCs, Rebuild Indexes, Update Statistics and all run without error (ie there are always successful and not any instance where it can't be done due to any connections), so do they NEED to be taken offline? What benefits will be gained by taking them offline?
RE: Maintenance on SQL 2012 - Do you have to take databases offline for mainenance
My point is... you cannot do any of that stuff while the database is offline.
There can be advantages with rebuilding indexes when the database is put in to single_user mode (and your process is the user that is connected to the database). However, if you are rebuilding indexes while nobody is connected anyway it should not matter. I say this because under normal circumstances, rebuilding an index will put a lock on the table for the duration of the rebuild. If it takes a long time to rebuild the index, this could lead to a blocking issue. Enterprise edition of SQL Server allows for ONLINE rebuild.
-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
RE: Maintenance on SQL 2012 - Do you have to take databases offline for mainenance
RE: Maintenance on SQL 2012 - Do you have to take databases offline for mainenance
We now have issues during restores because of this (know SQL 2012 error about the LSN chain). I can fix that by doing a restore by file no problem.
What I'm wondering though is how to do maintenance without logging (since we have a full backup). Is that even possible?
RE: Maintenance on SQL 2012 - Do you have to take databases offline for mainenance
You have broken the backup chain by placing the database into simple mode and the chain starts anew when you put the database back into Full recovery mode.
-SQLBill
The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875: What should I know before I post?
RE: Maintenance on SQL 2012 - Do you have to take databases offline for mainenance