Why This Error Happens
This error occurs when the registry keys associated with SQL Server Performance Counters (under HKLM\SOFTWARE\Microsoft\...\Performance) are either corrupted, missing, or inaccessible due to insufficient permissions. It is commonly triggered after a Windows Server 2025 cumulative update or a SQL Server 2025 patch that modifies the registry hive structure without properly re-registering the performance DLLs. Additionally, the Network Service or SQL Server Service Account may lack the required read permissions on the specific registry path referenced in the error.
Step-by-Step Resolution Guide
Step 1: Verify Registry Permissions
- Open
regeditand navigate toHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\Performance. - Right-click the key, select Permissions, and ensure the SQL Server service account (e.g.,
NT Service\MSSQLSERVER) has Read access. - Check the exact key path mentioned in the error log (replace
%lsplaceholders with the actual values found in the SQL Server Error Log) to confirm it exists.
Step 2: Rebuild Performance Counters
- Open Command Prompt as Administrator.
- Run
lodctr /Rto rebuild the default performance counter registry values from the backup stored in the.inifiles. - Restart the Windows Management Instrumentation (WMI) service via
services.mscto ensure the counter cache refreshes correctly.
Step 3: Re-register SQL Server Specific Counters
- Navigate to the SQL Server Binn directory, typically located at
C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Binn\. - Run the following command to unload and reload the specific SQL Server performance library:
unlodctr MSSQLSERVERfollowed bylodctr perf-MSSQLSERVERsqlctr.ini. - Restart the SQL Server (MSSQLSERVER) service to apply the new counter configuration.
Step 4: Run System File Checker (SFC)
- If the registry rebuild does not resolve the issue, corrupted system files might be preventing the registry write-back.
- Run
sfc /scannowin an elevated Command Prompt to repair underlying OS component dependencies required by the Performance Monitor.
Alternative or Verification Steps
- Verification: Open Performance Monitor (
perfmon.exe), attempt to add a counter from the “SQLServer:General Statistics” group. If the list populates without errors, the fix was successful. - Alternative: If counters remain disabled, use the
exctrlst.exe(Extensible Counter List) tool to manually check the “Performance Counters Enabled” flag for the SQL Server service and set it to Yes if it reads “No.”