There was one time when I was delivering a Service using a tool that gathers performance data through the SQL Server Counters on Performance Monitor, I got surprised when I tried to review the data and there were no information. Them I checked the SQL Server counter directly on Performance Monitor and the counters were not on the list. That’s why I decided to write this blog, to know what to do if the SQL Server counters on Performance Monitor disappears.

The right and easiest way to recover the SQL counters is to repair the SQL Server binaries, trough add/remove programs. However this will require downtime on the SQL instance (If you’re using a cluster you could do a switch-over to another node)

Therefore there’s another option, you could recover this counter executing the following steps:

First you need to open a command prompt console with administrative rights.

Go to the directory BINN on the SQL Instance you want to fix (Ex: C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn)

Now to avoid any inconsistency eliminate any leftovers of the SQL Counters using unlodctr MSSQLSERVER, for named instances use the format MSSQL$NombreInstancia

Now to load the counters you should use the following command lodctr perf-MSSQLSERVERsqlctr.ini, if you’re using a named instance you should use this format perf- MSSQL$NombreInstanciasqlctr.ini, you could execute the command twice to check that the counters have been added.

Note:i tried sqlctr.ini,but it doesn't work.then after i tried perf-mssqlserversqlctr.ini,then it worked.

Now you should restart the services Remote Registry and Performance Logs & Alerts, using the followings commands:

net stop "Remote Registry"  &&  net start "Remote Registry"

net stop "Performance Logs & Alerts"  &&  net start " Performance Logs & Alerts "

Note:if a counter of mssqlserver :buffer cache hit ratio = 0,restart mssql service,then the value will equal 100.

If you are using the previous procedure to recover the SQL counters on a SQL Server Cluster, you should rebuild the clusters on both nodes, when you are rebuilding the counters an Active SQL Instance must be on the node.

If after you have executed the above steps the SQL Counters have not appear, you will need to review the registry hives and keys (it’s not recommended to do any changes at the registry level, doing so could lead to instability on the operating system. If you chose to do these changes you should have a backup of the Operating System and Registry, to recover it if necessary), the following registry keys should exist and have a valid configuration.

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\<<service name>>\Performance]

Library 
Open 
Collect 
Close 
PerfIniFile

You should also check if there’s a key named Disable Performance Counters insideHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib, if it is configure with the value 1, it should be configure with 0. This should allow you to rebuild the registry counters and help files.

Now it may or not be necessary to rebuild the SQL and/or Operating System counters, look for the SQL Counters on perfmon, if they aren’t there use the previous steps to rebuild then, with the following command you can rebuild all the operating system counters.

cd %systemroot%\system32

lodctr /R

Another consideration that you should have is when you are executing SQL Server 32 bits on an Windows Server 64 bits environment

I hope this post is helpful, remember there’s a ton of good post on our blog that can help you on many SQL Server topics and how to Troubleshoot some problems. See you on the next post!

FROM:http://blogs.technet.com/b/pfelatam/archive/2011/08/08/sql-performance-counters-are-missing.aspx

找回丢失的SQL Server性能计数器的更多相关文章

  1. SQL Server性能计数器收集汇总方案(Reporting Service)

    通过收集计数器信息,并将计数器信息汇总为不同粒度存储,以Reporting Service报表服务器显示.以下是计数器收集汇总的基本架构. 笔者需要收集的SQL Server计数器包括:SQL Ser ...

  2. SQL Server性能计数器部署(批量)

    一.计数器部署项目介绍 SQL Server每个服务器,日常需要监控的计数器指标高达上百,若一个个手动添加非常麻烦.此项目通过命令行工具针对指定计数器集成部署,提高部署效率.此包括开发数据库互联(OD ...

  3. 怎样获取Windows平台下SQL server性能计数器值

    转载自工作伙伴Garrett, Helen "SQL Server Performance Counter captures" Capturing Windows Performa ...

  4. sql server 性能计数器

    常规计数器 收集操作系统服务器的服务器性能信息,包括Processor.磁盘.网络.内存 Processor 处理器 1.1 % Processor Time指处理器用来执行非闲置线程时间的百分比.通 ...

  5. [20141121]无法通过powershell读取sql server性能计数器问题

    背景: 全新服务器,需要增加性能监控,发现无法通过powershell读取性能指标 解决方法: Open the Registry Editor by going to the Start Menu ...

  6. SQL Server 损坏修复

    目录: 一. 常见错误解读 二. DBCC CHECKDB 三 .不同部位损坏的应对 四. Database Mirroring和AlwaysOn的页面自动修复功能 一 常见错误解读 SQL Serv ...

  7. SQL Server 性能优化详解

    故事开篇:你和你的团队经过不懈努力,终于使网站成功上线,刚开始时,注册用户较少,网站性能表现不错,但随着注册用户的增多,访问速度开始变慢,一些用户开始发来邮件表示抗议,事情变得越来越糟,为了留住用户, ...

  8. sql server等待类型

    sql server 各种等待类型-转 sql server各个等待类型及解决办法:https://www.sqlskills.com/help/waits/writelog/其他等待类型的描述和解决 ...

  9. SQL Server代理(3/12):代理警报和操作员

    SQL Server代理是所有实时数据库的核心.代理有很多不明显的用法,因此系统的知识,对于开发人员还是DBA都是有用的.这系列文章会通俗介绍它的很多用法. 如我们在这个系列的文章里所见,SQL Se ...

随机推荐

  1. JavaScript DOM高级程序设计 3.6 实例 将HTML代码转换成DOM代码(附源码)--我要坚持到底!

    作为一名Web开发者,最讨厌的事情就是重复性任务,摆脱乏味的日常重复性事物的一种方法,是借助可重用的对象或者说与你现在建立的ADS库类似的库,另外一种让事情变得有意思,且能够加速开发进程的方式是编写能 ...

  2. Oracle EBS Report 输出字符字段前部"0"被Excel自动去掉问题

    Oracle  EBS 提供多种报表的开发和输出形式,由于MS Excel在处理数据方面的优势明显,报表输出用Excel打开是很常见的开发项. 但是正是由于Excel的"过于智能而不智能&q ...

  3. JDK_Proxy_InvocationHandler_动态代理

    本文用jdk动态代理模拟了spring的AOP的实现技术 AOP面向切面编程,可用于权限验证,效率检查,事务,异常管理等 JDK的动态代理主要涉及到java.lang.reflect包中的两个类:Pr ...

  4. Unity3D集成SVN进行版本控制

    首先,AssetServer确实很好用,Unity内部集成的管理界面,操作很简单,提交冲突的后还可以进行文件比对.但学习使用过程中,发现文件体积较大的项目文件目录(600M),我提交不上去,会返回没有 ...

  5. 在Visual Studio 2010中使用DSL Tool特定领域开发 开篇

    本来是很想写关于VS的DSL的文章的,有点小忙,就一直在拖延,忽然有看见了"<在Visual Studio 2012中使用VMSDK开发特定领域语言>",又有写的欲望了 ...

  6. 卸载sqlserver数据库参考

    这多半是以前安装过MSSQL,没卸载干净导致的. 解决方法如下: 一.先把MSSQL卸载干净 1.在添加删除程序中把SQL Server卸载 :2.把Microsoft SQL Server文件夹整个 ...

  7. 实体框架Entity Framework 4.1快速入门

    介 绍 在旧的Entity 框架中,开发者可以从已存在的数据库中产生业务实体的模型,这种开发方法被称为数据库驱动的开发方法.而在4.1的Entity Framework中,支开发者先创建实体业务类,然 ...

  8. 说下 winOS / IOS / android /Linux 视频、音频 编码解码问题

    最近有朋友遇到一个问题, ios 上传视频文件,想在本地压缩下,然后再上传到服务器. 问有没有什么 视频处理的库, 最近Khronos的webgl 支持HTML5 ,(原理 WebGL 是openGL ...

  9. Delphi word

    [转载]在Delphi中使用CreateOleObject方法 (2011-08-24 14:20:47) 转载▼ 标签: 转载   原文地址:在Delphi中使用CreateOleObject方法作 ...

  10. 学习xcode 博客

    csdn http://blog.csdn.net/tianyitianyi1/article/category/1160169/2