There will be a requirement for rebuilding the system databases at the time of migration,master database is corrupted,collation difference between the system databases and user defined databases.or some times when system database are corrupted.

In SQL Server 2000 twe have a utlity called rebuildm.exe program located in the Microsoft SQL Server80ToolsBinn folder, but for SQL Server 2008, we can repair the SQL Server using SQL Server 2008 Installation CD.but if we have a requirement to rebulild the system databases with a differenct collation name, buy default SQL_Latin1_General_CP1_CI_AS collation is followed at the time of installation. to check the collation of your database run the below command

SELECT DATABASEPROPERTYEX(‘TEST_DB’,’COLLATION’)

Result

SQL_Latin1_General_CP1_CI_AS

you can even check the Summary.txt file located on C:Program FilesMicrosoft SQL Server100Setup BootstrapLog

to run the rebiuldĀ  sa user must be enable, user must have sysadmin credentials,and an instance name which you want to rebuild

Syntax

SETUP /Q /ACTION=REBUILDDATABASE /INSTANCENAME=MSSQLSERVERĀ  /SQLSYSADMINACCOUNTS=SERVERNAMEUSERNAME /SAPWD=P@ssw0rd /SQLCOLLATION=SQL_Latin1_General_CP1_CI_AS

once the command is executed sucessfully open summary.txt file located in C:Program FilesMicrosoft SQL Server100Setup BootstrapLog path.sucessfully output will be as below

as all the system databases are rebuild you need to attach the database,recreate the user login and Job roles,

Leave a Reply

Your email address will not be published. Required fields are marked *