Perfmon counters missing for newly added database in sql server 2005

Hello Everyone!

Recently I was working on a scenario in which we were not able to see any perfmon counters for newly added database. Evertytime we had to rebuild all the perfmon counters for sql server to get the perfmon counters of new database. It was just a workaround but we wanted to have a permanent resolution.

To find the cause of the problem, i checked the application logs and found the error:

The configuration information of the performance library ""C:\WINDOWS\system32\sqlctr90.dll"" for the ""MSSQLSERVER"" service does not match thetrusted performance library information stored in the registry. The functions in this library will not be treated as trusted.

 

Then I checked the method which was being followed to rebuild the counters and found:

1. Change the path to the BINN directory of the SQL Server instance you desire to correct. (Ex: C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\Binn)

2. Unload the counters:

For a default instance of SQL Server run this command:
unlodctr MSSQLSERVER

3. Check the .ini files by running a command on command prompt: - dir *.ini

 4. Execute lodctr /R:sqlctr.ini  

** LODCTR /R rebuild the perf registry strings and info from scratch based on the current

5. Restart the remote registry and then open perfmon and check if the missing counters are back otherwise restart the machine.

 To resolve the error :

The configuration information of the performance library ""C:\WINDOWS\system32\sqlctr90.dll"" for the ""MSSQLSERVER"" service does not match the trusted performance library information stored in the registry. The functions in this library will not be treated as trusted.

I had to just change the switch to /T

1. Change the path to the BINN directory of the SQL Server instance you desire to correct

. (Ex: C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\Binn)

2. Unload the counters:

For a default instance of SQL Server run this command:

unlodctr MSSQLSERVER

3. Check the .ini files by running a command on command prompt: - dir *.ini

4. Execute lodctr /T:sqlctr.ini

** LODCTR /T:<Service-Name> set the performance counter service as trusted.

5. Restart the remote registry and then open perfmon and check if the missing counters are back otherwise restart the machine.

After the above action plan the issue was resolved permanently

A very good blog on related issues : - https://blogs.msdn.com/b/psssql/archive/2009/03/03/troubleshooting-sql-server-2005-2008-performance-counter-collection-problems.aspx

Kind regards

Harsh Chawla