Sql-server – SQL Server 2012 Rebuild RAID Array

raidrestoresql serversql-server-2012

We had a bunch of disks fail in the RAID 10 that holds the data, logs, and backups drives on a SQL Server 2012 on Win 2012R2 OS. The OS and DB Server instance are in a separate RAID array.

Working with Dell, they recommend replacing the failed drives and then rebuilding the RAID array because the array has 300+ consecutive bad blocks. At this time, there is no obvious infidelity of data.

What would be the best steps to save my data, rebuild the array and restore the data? Would it be better to restore from backups or attach physical files? What happens to your SQL Server instances if there is no Master DB? It seems to me there are 2 possible scenarios

SCENARIO 1

Take the DBs offline or single user, backup all the DBs off the server, rebuild the RAID, reinstall SQL Server if necessary and restore all the DBs from backups.

SCENARIO 2

Turn off SQL Server services. Change SQL Server services to manual start. Copy all the log (.ldf) and data (.mdf, .ndf) files off the server, rebuild the array, copy the files back, and restart SQL services. Maybe I should take the backups first in this scenario as well.

What do you think?

Best Answer

It is a bad thing to put backups and live files on the same san array (or even on the same SAN). Your first step should be to allocate new storage for the backups, copy the backups on to that storage and then verify at least one of those backups. Then you should run check DB on the existing database to ensure it is not corrupt. After that create a fresh backup onto the separate storage for backups. For extra safety I would also take the databases offline, copy the MDF and ldf files onto the backup storage or another separate storage unit and then, after the array rebuild, see if the databases will come back up and pass another check DB. If not, then you can restore the backup or copy the file copies you made from the separate storage back to the live disk. Oh and you should enable checksum on the backup if you havent already done that. Having copies of the mdf and ldf files will give you a last resort option of data repair if the database was already corrupt.