转载自工作伙伴Garrett, Helen “SQL Server Performance Counter captures”

Capturing Windows Performance Counters for SQL Server

SQL Server Performance Counters

The following counters are the recommended list to capture baseline performance metrics for SQL Server:

  • Memory                                              Available Mbytes             (already added above)
  • Memory                                              Page Faults/sec                (already added above)
  • Memory                                              Page Reads/sec                                (already added above)
  • Memory                                              Page Writes/sec               (already added above)
  • Paging File                                           % Usage (_Total)              (already added above)
  • Processor                                            % Privileged Time (_Total)
  • Processor                                            % Processor Time (_Total)
  • Processor                                            % User Time (_Total)
  • Physical Disk                                       % Idle Time (_Total)
  • Physical Disk                                       Avg. Disk Queue Length (_Total)
  • Physical Disk                                       Avg. Disk sec/Read (_Total)
  • Physical Disk                                       Avg. Disk sec/Transfer (_Total)
  • Physical Disk                                       Avg. Disk sec/Write (_Total)
  • SQL Server: Access                              Methods/Page Splits/sec
  • SQL Server: Buffer Manager                  Buffer Cache Hit Ratio
  • SQL Server: Buffer Manager                  Page Life Expectancy
  • SQL Server: Buffer Manager                  Page Lookups/sec
  • SQL Server: Buffer Manager                  Page Reads/sec
  • SQL Server: Buffer Manager                  Page Writes/sec
  • SQL Server: General Statistics               User Connections
  • SQL Server: Memory Manager                Memory Grants Pending
  • SQL Server: SQL Statistics                    Batch Requests/sec
  • SQL Server: SQL Statistics                    SQL Compilations/sec
  • SQL Server: SQL Statistics                    SQL Recompilations/sec
  • SQL Server: Wait Statistics                   Memory Grant Queue Waits <all instances>
  • SQL Server: Wait Statistics                   Network IO Waits <all instances>
  • SQL Server: Wait Statistics                   Non-Page Latch Waits <all instances>
  • SQL Server: Wait Statistics                   Page IO Latch Waits <all instances>
  • SQL Server: Wait Statistics                   Page Latch Waits <all instances>
  • System                                               Processor Queue Length

TypePerf

Microsoft provides a command line utility “TypePerf” which allows capturing counters from a remote system to a monitoring system and logging these either to the command window or a log file. 

More information about the TypePerf command can be found at:

https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/nt_command_typeperf.mspx?mfr=true

Using TypePerf with an Input File

Create a folder on the monitoring server named “TypePerf”.

Create a new file in the TypePerf folder named
TypePerf_SQLCounters.txt.

Edit the TypePerf_SQLCounters.txt file by copying the following
contents into the file:

\\SERVERNAME\Memory\Available Bytes

\\SERVERNAME\Memory\Page Reads/sec

\\SERVERNAME\Memory\Page Writes/sec

\\SERVERNAME\Paging File(_Total)\% Usage

\\SERVERNAME\PhysicalDisk(_Total)\% Disk Time

\\SERVERNAME\PhysicalDisk(_Total)\Avg. Disk Queue Length

\\SERVERNAME\PhysicalDisk(_Total)\Avg. Disk sec/Read

\\SERVERNAME\PhysicalDisk(_Total)\Avg. Disk sec/Transfer

\\SERVERNAME\PhysicalDisk(_Total)\Avg. Disk sec/Write

\\SERVERNAME\Processor(_Total)\% Privileged Time

\\SERVERNAME\Processor(_Total)\% Processor Time

\\SERVERNAME\Processor(_Total)\% User Time

\\SERVERNAME\SQLServer:Access Methods\Page Splits/sec

\\SERVERNAME\SQLServer:Buffer Manager\Buffer cache hit ratio

\\SERVERNAME\SQLServer:Buffer Manager\Page life expectancy

\\SERVERNAME\SQLServer:Buffer Manager\Page lookups/sec

\\SERVERNAME\SQLServer:General Statistics\User Connections

\\SERVERNAME\SQLServer:Memory Manager\Memory Grants Pending

\\SERVERNAME\SQLServer:SQL Statistics\Batch Requests/sec

\\SERVERNAME\SQLServer:SQL Statistics\SQL Compilations/sec

\\SERVERNAME\SQLServer:SQL Statistics\SQL Re-Compilations/sec

\\SERVERNAME\SQLServer:Wait Statistics(*)\Memory grant queue
waits

\\SERVERNAME\SQLServer:Wait Statistics(*)\Network IO waits

\\SERVERNAME\SQLServer:Wait Statistics(*)\Page IO latch waits

\\SERVERNAME\SQLServer:Wait Statistics(*)\Page latch waits

\\SERVERNAME\System\Processor Queue Length

Perform a global replace of the SERVERNAME to match the actual server
name for the SQL Server that is to be monitored.  Save the file and Close.

--------------------------------------------------------------分割线---------------------------------------------------------------------------

Go to the Start menu -> Command Prompt.

Change the directory to the location where the TypePerf directory was created.

At the command prompt, modify the next command to match the information for the SQL Server being monitored:

TYPEPERF -cf F:\TypePerf\TypePerf_SQLCounters.txt -f csv -o F:\TypePerf\MSLAB2191_yyyymmdd_hhmm.csv -s BRTC_MSLAB2191

-cf           Name of the file that contains the list of counters to capture

-f             format of the log file, defaults to csv

-o            Path\name of output file

-s            Name of server to collect the counters from if one does not exist in the counter file

EXAMPLE:

TYPEPERF -cf F:\TypePerf\TypePerf_SQLCounters.txt -f csv -o F:\TypePerf\MSLAB2191_20161020_2025.csv -s BRTC_MSLAB2191

Press Enter to start the counter collection…

The [\]   will run the command and capture the counters every second.

Verify the file you specified for the output was created and is growing:

-------------------------------------------------------分割线-----------------------------------------------------------------------

When you have completed the SQL Server test, Press CTRL-C to stop the counter collection.

Close the Command Prompt window.

怎样获取Windows平台下SQL server性能计数器值的更多相关文章

  1. Windows平台下MySQL常用操作与命令

    Windows平台下MySQL常用操作与命令 Windows平台下MySQL常用操作与命令,学习mysql的朋友可以参考下. 1.导出整个数据库 mysqldump -u 用户名 -p --defau ...

  2. Windows平台下Git服务器搭建

    第一步:下载Java,下载地址:http://www.java.com/zh_CN/ 第二步:安装Java.安装步骤不再详述. 第三步:配置Java环境变量. 右键”计算机” => ”属性” = ...

  3. Windows 平台下Git 服务器搭建

    由于项目中一直在使用git作为版本管理,自己对git的理解.使用都还不是怎么的熟悉,所以准备深入了解一下git及一些常用命令的使用,于是干脆把服务端架上,通过自己的PC作为服务端同时作为客户端的角色进 ...

  4. windows平台下VLC2.0.5编译

    windows平台下VLC2.0.5编译说明 时隔一年多,又要搞流媒体了,不过这次是要做流媒体服务器. 暂时决定使用vlc+ffmpeg+live555,虽然听有些前辈说这个组合的性能较差,只能作为学 ...

  5. 【转】Windows平台下Git服务器搭建

    Windows平台下Git服务器搭建 Posted on 2015-05-18 21:29 阿祥当码农 阅读(7637) 评论(0) 编辑 收藏 该文章转自:http://www.codeceo.co ...

  6. Windows平台下的node.js安装

    Windows平台下的node.js安装 直接去nodejs的官网http://nodejs.org/上下载nodejs安装程序,双击安装就可以了 测试安装是否成功: 在命令行输入 node –v 应 ...

  7. windows平台下nginx+PHP环境安装

    因为日常工作在windows下,为方便在window是下进行PHP开发,需要在windows平台下搭建PHP开发环境,web服务器选择nginx,不过windows版本的nginx性能要比Linux/ ...

  8. Windows平台下Oracle实例启动过程中日志输出

    Windows平台下Oracle实例启动过程中日志输出记录. 路径:D:\app\Administrator\diag\rdbms\orcl\orcl\trace\alert_orcl.log 输出内 ...

  9. windows系统与SQL SERVER 2008数据库服务性能监控分析简要

    软件系统性能测试体系流程介绍之windows系统与SQL SERVER 2008数据库服务性能监控分析简要 目前大部分测试人员对操作系统资源.中间件.数据库等性能监控分析都是各自分析各自的监控指标方式 ...

随机推荐

  1. 宿主机远程桌面连接vmware中的虚拟机

    参考了:http://jingyan.baidu.com/article/3052f5a1e8c56397f21f8674.html   感谢~ 宿主机安装了vmware,vmware中安装虚拟机,怎 ...

  2. solr了解的一些东西

    近一周学习了一下solr,大概了解了一些东西,学会了如何为数据库中数据添加索引,中文分词怎样使用的一些知识 1.在网上的大多资料都是使用solr要安装tomacat,一时很迷茫,tomacat我理解是 ...

  3. Swift 必备开发库10个

    1.CryptoSwift swift加密库, 支持md5,sha1,sha224,sha256... github地址: https://github.com/krzyzanowskim/Crypt ...

  4. 使用bootstrap 弹出效果演示

    前言:对于Web开发人员,弹出框和提示框的使用肯定不会陌生,比如常见的表格新增和编辑功能,一般常见的主要有两种处理方式:行内编辑和弹出框编辑.在增加用户体验方面,弹出框和提示框起着重要的作用,如果你的 ...

  5. Reveal - UI 分析工具

    一.安装和简介 a) download url b) Reveal 使用的方法有两种: Static Library Intefration, Dynamic Library Intefration. ...

  6. 点单登录原理和java实现简单的单点登录

    引用自:http://blog.csdn.net/zuoluoboy/article/details/12851725 摘要: 单点登录(SSO)的技术被越来越广泛地应用到各个领域的软件系统当中.本文 ...

  7. 微博开放平台api使用

    前言:微博开放平台提供了微博数据的api接口,不仅可以直接通过api调用微博服务发布微博查询微博,更重要的是,可以在自己的网站上获得新浪微博api的授权,调用微博的某些内容,就好像我们再网站中看到好文 ...

  8. django小结

    初始化项目 python manage.py runserver python manage.py runserver 127.0.0.1:8080 python manage.py startapp ...

  9. ui-grid

    html代码: <html ng-app="myApp">       <head>         <meta charset="utf- ...

  10. java.lang.IllegalArgumentException: Result Maps collection does not contain value for java.lang.Integer

    今天做springmvc+mybatis+spring的项目的时候发现了一个异常.如下: org.apache.ibatis.builder.IncompleteElementException: C ...