Thursday, September 9, 2010

Installing SQL Server 2008 – reboot required check fails

When installing SQL Server 2008 or rebuilding it, one can run into “‘Reboot required check failed” situation.

Try to reboot first and if that wouldn’t help try out the following

1. Start regedit.exe
2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
3. Locate PendingFileRenameOperations
4. Remove any data associated with the value ( copy the values as you may want to export the value for later review)
5. Reboot the machine.
6. Make sure that after you reboot entry in the registry does not reappear
7. If it does, remove it again, but do not reboot, just go ahead with installation process

Changing the default collation for a SQL instance in SQL 2008

Before Rebuilding the Databases:

Perform the following tasks before you rebuild the system databases to ensure that you can restore the system databases to their current settings.

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. Take a backup of all the databases including the system databases

5. If the instance of SQL Server is configured as a replication Distributor, locate the current backup of the distribution database.
6. Ensure you have appropriate permissions to rebuild the system databases. To perform this operation, you must be a member of thesysadmin fixed server role. For more information, see Server-Level Roles.
7. Verify that copies of the master, model, msdb data and log template files exist on the local server. The default location for the template files is C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\Templates. These files are used during the rebuild process and must be present for Setup to succeed. If they are missing, run the Repair feature of Setup, or manually copy the files from your installation media. To locate the files on the installation media, navigate to the appropriate platform directory (x86, x64, or ia64) and then navigate to setup\sql_engine_core_inst_msi\Pfiles\SqlServr\MSSQL.X\MSSQL\Binn\Templates.

To rebuild system databases for an instance of SQL Server:

1. If it is a cluster, Put off line SQL Server resource by using Failover Cluster Management

2. Go on the node where this clustered instance is owned

3. Insert the SQL Server 2008 R2 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\100\Setup Bootstrap\Release.

4. 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]

Note: [ /SAPWD= StrongPassword ] is only required if you are using mixed mode authentication

Example:
setup.exe /QUIET /ACTION=RebuildDatabase /INSTANCENAME=INST1 /SQLSYSADMINACCOUNTS="testdomain\sqladmin" /SAPWD="PaSSw0rd124##$" /SqlCollation=SQL_Latin1_General_CP1_CI_AS

Note: It is always better to use the installation media as some of the users reported errors when using the setup.exe from the local server

5. 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.

6. Restore the databases (Do not restore the system databases if you have changed the collation)

7. Check the product versions and apply patches if required