To rebuild system databases for an instance of SQL Server

To rebuild system databases for an instance of SQL Server

  • Insert the SQL Server 2008 R2 installation media into the disk drive.
  • From a command prompt window, enter the following command. Square brackets are used to indicate optional parameters. Do not enter the brackets. When using the Windows Vista operating system with User Account Control (UAC) enabled, running Setup requires elevated privileges. The command prompt must be run as Administrator.Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=InstanceName /SQLSYSADMINACCOUNTS=accounts [ /SAPWD= StrongPassword ] [ /SQLCOLLATION=CollationName]

 

Parameter name Description
/QUIET or /Q Specifies that Setup run without any user interface.
/ACTION=REBUILDDATABASE Specifies that Setup re-create the system databases.
/INSTANCENAME=InstanceName Is the name of the instance of SQL Server. For the default instance, enter MSSQLSERVER.
/SQLSYSADMINACCOUNTS=accounts Specifies the Windows groups or individual accounts to add to the sysadmin fixed server role. When specifying more than one account, separate the accounts with a blank space. For example, enter BUILTIN\Administrators MyDomain\MyUser. When you are specifying an account that contains a blank space within the account name, enclose the account in double quotation marks. For example, enter NT AUTHORITY\SYSTEM.
[ /SAPWD=StrongPassword ] Specifies the password for the SQL Server saaccount. This parameter is required if the instance uses Mixed Authentication (SQL Server and Windows Authentication) mode.

Security noteSecurity Note
The sa account is a well-known SQL Server account and it is often targeted by malicious users. It is very important that you use a strong password for the sa login.

Do not specify this parameter for Windows Authentication mode.

[ /SQLCOLLATION=CollationName ] Specifies a new server-level collation. This parameter is optional. When not specified, the current collation of the server is used.

Important noteImportant
Changing the server-level collation does not change the collation of existing user databases. All newly created user databases will use the new collation by default.

For more information, see Setting and Changing the Server Collation.

  • When Setup has completed rebuilding the system databases, it returns to the command prompt with no messages. Examine the Summary.txt log file to verify that the process completed successfully. This file is located at C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Logs.