580
Part V: Enterprise Data Management
Be sure to back up the master database when doing any of the following:
■ Creating or deleting databases
■ (^) Modifying security by adding logins or changing roles
■ Modifying any server or database-confi guration options
Because the msdb database holds a record of all backups, back up the master database and
then the msdb database.
Recovering the Master Database
If the master database is corrupted or damaged, SQL Server won't start. Attempting to start
SQL Server will have no effect. Attempting to connect to the instance with Management Studio
invokes a warning that the server does not exist or that access is denied. The only solution is to
fi rst rebuild the master database using the command line setup as shown next, reapply any SQL
Server updates, start SQL Server in single-user mode, and restore the master database.
- Rebuild the master database using the command line setup:
setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=""
/SQLSYSADMINACCOUNTS="<DomainName\UserName >" /SAPWD=""
where
■ setup.exe is either from your original installation media or the “local” setup
.exe as found in the 110\Setup Bootstrap\SQLServer2012 directory.
■ /QUIET switch suppresses all error messages.
■ (^) /ACTION=REBUILDDATABASE switch rebuilds all the system databases.
■ /INSTANCENAME switch specifi es the name of your SQL Server named instance.
Use MSSQLServer for “
■ /SQLSYSADMINACCOUNTS switch corresponds to the currently-logged in
domain user running this rebuild process. The user must be a member of the SQL
instance's sysadmin server role.
■ (^) /SAPWD switch is used to indicate a new SA password if you confi gured SQL
Server for mixed authentication.
A new feature was added to rebuilding the system databases in the last release. The system databases used for
rebuilding the local system databases no longer come from the original installation media and are located locally
in the C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn\
Templates\ folder, and setup.exe is located in the C:\Program Files\Microsoft SQL Server\110\
Setup Bootstrap\SQLServer2012SQLServer2012 folder. The switches have changed
as compared to SQL Server 2005.
c21.indd 580c21.indd 580 7/31/2012 9:22:54 AM7/31/2012 9:22:54 AM
http://www.it-ebooks.info