重建SQL Server 2005/2008丢失的Performance counter

2024-01-13 15:48

本文主要是介绍重建SQL Server 2005/2008丢失的Performance counter,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

有时候会发现需要监控SQL Server性能的时候发现Perfom中没有SQL Server的Counter,用下面的方法可以重新加载SQL Server Perfom counter. 注意这个操作完成后需要重启SQL Server servcie,所以需要找Maintaince的时间做下面的操作。


1.First you need to identify which .ini file is used for your SQL instance. The counters for the SQL database engine are included inside the file called sqlctr.ini which can be found inside the BINN folder of SQL server.


2.Open a command prompt and navigate inside the BINN folder of the SQL instance that interests you. E.g. browse to this folder: C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn.


3.Remove the current performance counters of the SQL instancxe by using the unlodctr command.

For a default instance of SQL Server run this command:

unlodctr MSSQLSERVER

For a named instance of SQL server (e.g. called namedInstance) run this command:

unlodctr MSSQL$namedInstance


4.Now you need to reload the SQL counters.

Run this command:

lodctr sqlctr.ini

If no messages are returned, this means the command succeeded.

Restart the SQL Server service (or do a failover of the SQL Group if this is a SQL failover instance).

Now the counters should have appeared again.

Your issue might be resolved with these steps. If not, there is a possibility that the sqlctr.ini file you are using is not right (maybe it somehow got corrupted). In this case, you will need to copy the sqlctr.ini file from another SQL Server that is the same version.


So in this case the steps are:


1.Copy the sqlctr.ini file from another SQL instance’s BINN folder.


2.Use Notepad to edit the sqlctr.ini file so that the driver name is correct for the original SQL instance.

e.g. for a default instance, the [info] tab should look like this:

[info]

drivername=MSSQLServer

trusted=

symbolfile=sqlctr.h

e.g. for a named instance the [info] tab should look like this:

[info]

drivername=MSSQL$namedInstance

trusted=

symbolfile=sqlctr.h


3.Remove the current performance counters of the SQL instancxe by using the unlodctr command.

For a default instance of SQL Server run this command:

unlodctr MSSQLSERVER

For a named instance of SQL server (e.g. called namedInstance) run this command:

unlodctr MSSQL$namedInstance


4.Now you need to reload the SQL counters.

Run this command:

lodctr sqlctr.ini

If no messages are returned, this means the command succeeded.

Restart the SQL Server service (or do a failover of the SQL Group if this is a SQL failover instance).

Normally the SQL counters should have appeared by now. If not, there is a possibility that the registry keys related to the SQL performance counters (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLServer\Performance\Library) are incorrect, missing or have inappropriate security settings.

You should better contact Microsoft Support Services for troubleshooting a specialized issue like this.


这篇关于重建SQL Server 2005/2008丢失的Performance counter的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/601978

相关文章

mysql递归查询语法WITH RECURSIVE的使用

《mysql递归查询语法WITHRECURSIVE的使用》本文主要介绍了mysql递归查询语法WITHRECURSIVE的使用,WITHRECURSIVE用于执行递归查询,特别适合处理层级结构或递归... 目录基本语法结构:关键部分解析:递归查询的工作流程:示例:员工与经理的层级关系解释:示例:树形结构的数

SQL常用操作精华之复制表、跨库查询、删除重复数据

《SQL常用操作精华之复制表、跨库查询、删除重复数据》:本文主要介绍SQL常用操作精华之复制表、跨库查询、删除重复数据,这些SQL操作涵盖了数据库开发中最常用的技术点,包括表操作、数据查询、数据管... 目录SQL常用操作精华总结表结构与数据操作高级查询技巧SQL常用操作精华总结表结构与数据操作复制表结

查看MySQL数据库版本的四种方法

《查看MySQL数据库版本的四种方法》查看MySQL数据库的版本信息可以通过多种方法实现,包括使用命令行工具、SQL查询语句和图形化管理工具等,以下是详细的步骤和示例代码,需要的朋友可以参考下... 目录方法一:使用命令行工具1. 使用 mysql 命令示例:方法二:使用 mysqladmin 命令示例:方

MySQL 复合查询案例详解

《MySQL复合查询案例详解》:本文主要介绍MySQL复合查询案例详解,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录基本查询回顾多表笛卡尔积子查询与where子查询多行子查询多列子查询子查询与from总结合并查询(不太重要)union基本查询回顾查询

MySQL复合查询从基础到多表关联与高级技巧全解析

《MySQL复合查询从基础到多表关联与高级技巧全解析》本文主要讲解了在MySQL中的复合查询,下面是关于本文章所需要数据的建表语句,感兴趣的朋友跟随小编一起看看吧... 目录前言:1.基本查询回顾:1.1.查询工资高于500或岗位为MANAGER的雇员,同时还要满足他们的姓名首字母为大写的J1.2.按照部门

Linux搭建单机MySQL8.0.26版本的操作方法

《Linux搭建单机MySQL8.0.26版本的操作方法》:本文主要介绍Linux搭建单机MySQL8.0.26版本的操作方法,本文通过图文并茂的形式给大家讲解的非常详细,感兴趣的朋友一起看看吧... 目录概述环境信息数据库服务安装步骤下载前置依赖服务下载方式一:进入官网下载,并上传到宿主机中,适合离线环境

MySQL主从同步延迟问题的全面解决方案

《MySQL主从同步延迟问题的全面解决方案》MySQL主从同步延迟是分布式数据库系统中的常见问题,会导致从库读取到过期数据,影响业务一致性,下面我将深入分析延迟原因并提供多层次的解决方案,需要的朋友可... 目录一、同步延迟原因深度分析1.1 主从复制原理回顾1.2 延迟产生的关键环节二、实时监控与诊断方案

慢sql提前分析预警和动态sql替换-Mybatis-SQL

《慢sql提前分析预警和动态sql替换-Mybatis-SQL》为防止慢SQL问题而开发的MyBatis组件,该组件能够在开发、测试阶段自动分析SQL语句,并在出现慢SQL问题时通过Ducc配置实现动... 目录背景解决思路开源方案调研设计方案详细设计使用方法1、引入依赖jar包2、配置组件XML3、核心配

MySQL数据库约束深入详解

《MySQL数据库约束深入详解》:本文主要介绍MySQL数据库约束,在MySQL数据库中,约束是用来限制进入表中的数据类型的一种技术,通过使用约束,可以确保数据的准确性、完整性和可靠性,需要的朋友... 目录一、数据库约束的概念二、约束类型三、NOT NULL 非空约束四、DEFAULT 默认值约束五、UN

电脑找不到mfc90u.dll文件怎么办? 系统报错mfc90u.dll丢失修复的5种方案

《电脑找不到mfc90u.dll文件怎么办?系统报错mfc90u.dll丢失修复的5种方案》在我们日常使用电脑的过程中,可能会遇到一些软件或系统错误,其中之一就是mfc90u.dll丢失,那么,mf... 在大部分情况下出现我们运行或安装软件,游戏出现提示丢失某些DLL文件或OCX文件的原因可能是原始安装包