SQL Server 2008 R2 – The performance counter registry hive is corrupted.

Sequel number four (yes, 4!) of the SQL Server 2008 R2 installation woes saga.

Previous posts include:

  1. Version string portion was too short or too long
  2. Error code: 1605
  3. Version’s parameters must be greater than or equal to zero

This post discusses the following error which appears in Summary_%computername%_%date%_%time%.txt, located in C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log:

The performance counter registry hive is corrupted. To continue, you must repair the performance counter registry hive. For more information, see http://support.microsoft.com/kb/300956.

Performance counters

In normal circumstances, the value of Last Counter (e.g. 13400), located in HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib, should match the Counter counterpart, located just beneath the previous key, in HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib09. The exact same value should be there in the end of the large string.

Investigation of the registry’s keys and values on the erroneous target machine reveals a mismatch between the above values. In other words, we are dealing with performance counter corruption, also confirmed by the fact that trying to add a new counter in perfmon.msc (by clicking the + button), results in a dialog window popping up showing no performance counters to choose from.


In order to fix the performance counter corruption, the performance counters have to be rebuilt. Simply follow the procedure as outlined in KB300956 step by step. If several Windows XP SP3 clients demonstrate the exact same problem, a batch file can come in handy to fix the issue swiftly. Here’s a procedure to create such file.

1) Expand perfc009.da_ and perfh009.da_ in the i386 folder of Windows XP’s original sources, and put both files in a separate directory, e.g. PerfMonFix.

2) In the PerfMonFix directory, create a new file PerfMonFix.bat with the following contents:

xcopy %~dp0*.dat %systemroot%\system32 /y
cd /d %systemroot%\system32
for /f "tokens=1 delims=:" %%i in ('findstr drivername *.ini') do lodctr /r:%%i

On the target machine, execute PerfMonFix.bat and launch the SQL Server 2008 R2 installer after verification of the performance counters. The error should be gone.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s