February 2011 Entries

How to resolve Performance counter registry hive consistency check SQL Server 20008

Posted Thursday, February 03, 2011 10:46 PM | Feedback (8),

Today I was trying to install a new version of SQL Server 2008 R2 into my dev box that my current customer has handed me. First of all I need to do an upgrade because when I first got the PC I installed Visual Studio 2008, which by default installs SQL Express 2005. To do an SQL upgrade install you must run the installation from a command prompt and administration rights with this command setup.exe SKUUPGADE=1 if you don’t your upgrade will fail.

Anyway my setup failed for a whole different reason. After doing some next next clicking the setup got to the Setup Support Rules and all checks passed with exception to the cryptic error of Performance counter registry hive consistency check.

This issue seems to affect users with a non English version of the OS. I run a Swedish Windows 7 version. The only way to resolve this issue is to hack the registry. I found these steps from by Scot Ma in a msdn forum.

Use this program to find out what LICD your system have.

Here is the code it uses. If you have the .NET compiler you can create a console application and cpmpile your own.

using System;
using System.Globalization;

namespace CurrentSystemLICD
{
    class CurrentSystemLicd
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Your LCID: " + string.Format("{0,3}", CultureInfo.InstalledUICulture.Parent.LCID.ToString("X")).Replace(" ", "0")); 
            Console.WriteLine("Press any key to exit");
            Console.ReadLine();
        }
    }
}

2) Once you figure out which key it is (my key for my Swedish Windows7 is 01D). Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib and copy the whole 009 folder, edit the exported .reg file and change the 009 value to your own LCID. Then import the edited file.

Open the text value of HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009\Counter and scroll to the second last line. You will see a number like this, write down the number. This is the Last Counter number the system uses

e.g.:
11838
Cumulative Guest Run Time

3) do the same for HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009\Help and write down the number. This is the Last Help number the system uses

e.g.:
11839
The guest run time represents the number of microseconds the .....

4) Now go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\Last Counter. Put the number from (2) as the new value of Last Counter

5) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\Last Help. Put the number from (3) as the new value of Last Help

After following these steps I managed to get my installation going.

Good luck!