This article describes how to manually rebuild the
performance counter library values.
This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
How to back up and restore the registry in Windows
When you use the System Monitor tool, some
counters may be missing or do not contain counter data. The base set of
performance counter libraries may become corrupted and may need to be rebuilt. Additionally, you may need to rebuild any custom (.NET Framework application created) counters or any extensible counters.
This behavior may occur if certain
extensible counters corrupt the registry, or if some Windows Management
Instrumentation (WMI)-based programs modify the registry.
Rebuild the base performance counters
counter information is stored in both of the following locations:
To rebuild the base performance counter libraries manually, follow these steps:
- Expand the Perfc009.dat file and the
Perfh009.dat file. These files are located on the Windows Installation Disc. The compressed files are found at DriveLetter:\i386\perfc009.da_ and at DriveLetter:\i386\perfh009.da_. Replace the files that are in the %Systemroot%\System32 folder.
- Start Registry Editor, and then locate the following key in
- In the registry, change the Last Counter
value to 1846 (decimal), and change the Last Help value to 1847 (decimal).
- Locate the following registry key to search for services that have a Performancesubkey:
- Remove the following values from the Performance subkey (if
You can also use the Exctrlst.exe tool to locate the
performance counter dynamic-link library files (DLLs) that are installed, and
then access the registry to remove the DWORD values. You now have a workable
performance registry that contains only system base counters.
- First Counter
- First Help
- Last Counter
- Last Help
Note Removing the values from the Performance subkey in the registry may cause any installed .NET Framework applications not to work the next time that they are started. If this occurs, use the lodctr /R command in the "Re-add the extensible counters" section to rebuild the Performance counters. If you continue to have problems when you start a .NET Framework application, see the "Reinstall any custom .NET Framework assembly performance counters" section in this article.
Re-add the extensible counters
You must re-add the
extensible counters from the list of services. Before you do this, you
must identify the .ini file that is used to load the counters:
- Open a Command Prompt window.
- At the command prompt, type cd
%Systemroot%\System32, and then press ENTER.
- At the command prompt, type findstr drivername
*.ini, and then press ENTER.
- Note the name of the .ini file for each drivername in the
- At the command prompt, type the following command, and then
Note In this command, <inifile> represents the name of the .ini
file for the driver that you want to reload.For example, if you
want to reload the ASP driver, the list that you noted in step 4 shows that
Axperf.ini is the .ini file for the ASP driver (axperf.ini:drivername=ASP).
Therefore, to reload the ASP driver, type lodctr
axperf.ini at the command prompt, and then press ENTER.
- Repeat step 5 for each .ini file in the list.
- Restart your computer.
To rebuild all Performance counters including extensible and third-party counters in Windows Server 2003, type the following commands at a command prompt. Press ENTER after each command.
- /R is uppercase. You must have administrative rights on the computer to successfully perform this command.
- On a computer that is running a 32-bit edition of Windows XP, the Lodctr /R:<filename> command is the standard method to restore performance counter registry strings and information by using a file name.
Windows Server 2003 rebuilds all the counters because it reads all the .ini files in the C:\Windows\inf\009 folder for the English operating system.
- If you are running a Cluster or Datacenter product, you must
fail over the node to refresh the counter list. You must do this after you perform the steps
under "Re-add the extensible counters" for both base counters and extensible counters.
- On systems that are running applications
that add their own performance counters, such as Microsoft Exchange or SQL Server,
the .ini file that is used to load the performance counter may not be located
in %Systemroot%\System32. These .ini files can usually be found under the
applications folder structure.
- If you receive an error message about the performance library
when you use the previous steps, you may have to unload and reload the IIS
performance dynamic link libraries (DLLs).
For more information
about how to do this, click the following article number to view the article in the Microsoft Knowledge Base:
Event ID 2003 Warning message logged when loading performance counters
- If you continue to experience problems when you start a .NET Framework application, see the "Reinstall any custom .NET Framework assembly performance counters" section.
Reinstall any custom .NET Framework assembly performance counters
If you continue to have problems when you start a .NET Framework application after you perform the procedures that are listed here, you may have to rebuild the Performance counters for the custom .NET Framework application. To do this, use the "/i" option in the .NET Framework Installer Tool (Installutil.exe). You must know the file names of the DLL files that create the Performance counters.Example
If you follow these procedures and remove the counters from the registry for all services installed on a system that has Microsoft System Center Operations Manager 2007 installed, you might have a broken Management Server. This is because the counters for the Config Service, SDK Service, and Database Write modules are not provided in the form of extensible counters in INI files. Instead, they are registered at the time of installation. Therefore, when you try to start System Center Operations Manager 2007, you may receive an error message that resembles the following because the performance counters are missing:
Event Type: Error
Event Source: OpsMgr SDK Service
Event Category: None
Event ID: 26380
The System Center Operations Manager SDK Service failed due to an unhandled exception.
To resolve this problem in System Center Operations Manager 2007, you must reinstall the .NET Framework assemblies that created the performance counters. To do this, use the /i option in the .NET Framework Installer Tool (Installutil.exe) to reinstall the following assemblies:
For example, at the command prompt, type the following commands, and then press ENTER after each command:
InstallUtil /i Microsoft.Mom.ConfigService.dllNote
InstallUtil /i Microsoft.Mom.Sdk.ServiceDataLayer.dll
InstallUtil /i Microsoft.Mom.DatabaseWriteModules.dll
InstallUtil /i Microsoft.EnterpriseManagement.HealthService.Modules.DataWarehouse.dll
You must have administrative rights on the computer to successfully perform these commands.