Recovering from a lost MDF file in SQL Server


For all but the extremely lucky in the IT world, there comes a point when you realise that your backup procedures are somewhat inadequate. Backups are often not taken into serious consideration by management, and with the modern more-with-less attitude to IT departments, nobody really has the time to maintain backup procedures.
I had my wake-up call yesterday, mid-afternoon, when we suffered a series of unexpected and unlikely failures that ultimately combined to cause serious file-system corruption on the disk that houses an important database's master database file (.MDF
). With the database gone, but the previous night's backup and the transaction logs (.LDF
) intact, recovering the database to the point of the incident wasn't particularly easy for someone who's not a DBA.