SQL Server 2000
To rebuild the master database
1. Shutdown Microsoft® SQL Server™ 2000, and then run Rebuildm.exe. This is located in the Program Files\Microsoft SQL Server\80\Tools\Binn directory.
(C:\Program Files\Microsoft SQL
Server\80\Tools\BINN\Rebuildm.exe)
2. In the Rebuild Master dialog box, click Browse.
3. In the Browse for Folder dialog box, select the \Data folder on the SQL Server 2000 compact disc or in the shared network directory from which SQL Server 2000 was installed, and then click OK.
4. Click Settings. In the Collation Settings dialog box, verify or change settings used for the master database and all other databases.
Initially, the
default collation settings are shown, but these may not match the collation
selected during setup. You can select the same settings used during setup or
select new collation settings. When done, click OK.
5. In the Rebuild Master dialog box, click Rebuild to start the process.
The Rebuild Master utility reinstalls
the master database.
SQL Server 2005
Need CD
1.START /WAIT <media drive and path>\setup.exe /qn INSTANCENAME=<INSTANCE NAME> REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=<STRONG SA PASSWORD>
Check summery.txt
2. Test the server by starting the instance in single-user mode and connect using SQLCMD
Restore MASTER database using your latest SQL Server full database backup. This MUST be run in single user mode.
In the previous step we logged out and shutdown the instance. Start the SQL instance in single-user mode via command prompt, connect using SQLCMD and restore master database. See steps below.
2 -
GO
SQL Server 2008 & 2014
Prerequisites
1. Record all server-wide configuration values.
SELECT * FROM sys.configurations;
2. Record all service packs and hotfixes applied to the instance of SQL Server and the current collation. You must reapply these updates after rebuilding the system databases.
SELECT
SERVERPROPERTY('ProductVersion ') AS ProductVersion,
SERVERPROPERTY('ProductLevel') AS ProductLevel,
SERVERPROPERTY('ResourceVersion') AS ResourceVersion,
SERVERPROPERTY('ResourceLastUpdateDateTime') AS ResourceLastUpdateDateTime,
SERVERPROPERTY('Collation') AS Collation;
3. Record the current location of all data and log files for the system databases. Rebuilding the system databases installs all system databases to their original location. If you have moved system database data or log files to a different location, you must move the files again.
SELECT name, physical_name AS current_file_location
FROM sys.master_files
WHERE
database_id IN (DB_ID('master'), DB_ID('model'), DB_ID('msdb'), DB_ID('tempdb'));
4. Locate the current backup of the master, model, and msdb databases.
5. If the instance of SQL Server is configured as a replication Distributor, locate the current backup of the distribution database.
To rebuild system databases for an
instance of SQL Server:
1. Insert the SQL Server 2014 installation media into the disk drive, or, from a command prompt, change directories to the location of the setup.exe file on the local server. The default location on the server is C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Release.
2. From a command prompt window, enter the following command. Square brackets are used to indicate optional parameters. Do not enter the brackets. When using a Windows operating system that has User Account Control (UAC) enabled, running Setup requires elevated privileges. The command prompt must be run as Administrator.
No comments:
Post a Comment