We have a third-party server backup tool running every 24 hours, which backs up everything (files and database in preparation for a bare-metal restore). After much investigation, it emerged that the tool used non copy_only
backups, thus destroying the log chain on both the system databases, and our own.
(I've been researching whether the system databases should be backed up, and the consensus is generally yes because of the data they hold concerning SQL Server in general (e.g. users, agent jobs, etc). This isn't so much about their contents, but what would happen if they were missing after a restore because of the situation I describe).
To stop this crime, I've disabled the tool performing database backups, so now it only does file backups (except the MDF/LDF files). I then have scheduled SQL Agent to run backups every hour and I then sent them to my private cloud.
In the event of complete server failure, and a bare metal backup was required, I expect that the databases wouldn't be there when SQL started back up, as they weren't backed up/restored by the tool (although I have them safely backed up).
What actually happens at this point? Does SQL Server re-create the system databases, which I then can restore over? Or, does it just refuse to start up and I'm heading for trouble?
Best Answer
Answering the initial question
No.
Providing a solution
The procedure of restoring the system databases is explained in the following Microsoft Article:
Reference: Rebuild System Databases (SQL Server 2012)
Prerequisites
Restore steps
Rebuild the system databases:
Verify that the installation was successful by consulting the setup summary file:
Restore the most recent backups of the system databases:
master
,msdb
, (model
):master
database start the SQL Server instance from a DOS prompt with the-m
parameter.Reference: Restore the master Database (Transact-SQL) for more details
When restoring the
msdb
database start the SQL Server instance with the Trace Flag 3608:Reference: Trace Flags (Transact-SQL)
Rebuild the
ressource
database:Restore your User databases
Please read