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

转载自工作伙伴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.

时间: 2024-08-28 17:46:22

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

SQL Server性能计数器架构

WINDOWS性能计数器介绍 操作系统可以使用性能监视器图形工具来测量系统.应用程序.服务.驱动程序的性能信息.通过性能计数器可以查看SQL Server对象.性能计数器以及其他对象的行为,这些对象包括处理器.内存.缓存.线程和进程.每个对象都有一个相关的计数器集,用于测量设备的使用情况.队列长度.延迟情况. 为了方便批量管理,可以通过命令语句查看和添加计数器.PerfMon.exe中可以查看性能对象.性能计数器和对象实例,可通过添加计数器来查看相关描述信息.TypePerf.exe可以把Win

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

Windows平台下Oracle实例启动过程中日志输出记录. 路径:D:\app\Administrator\diag\rdbms\orcl\orcl\trace\alert_orcl.log 输出内容: Sat Aug 06 20:39:55 2016 Starting ORACLE instance (normal) LICENSE_MAX_SESSION = 0 LICENSE_SESSIONS_WARNING = 0 Picked latch-free SCN scheme 3 Usin

Windows 平台下Git 服务器搭建

由于项目中一直在使用git作为版本管理,自己对git的理解.使用都还不是怎么的熟悉,所以准备深入了解一下git及一些常用命令的使用,于是干脆把服务端架上,通过自己的PC作为服务端同时作为客户端的角色进行折腾了...本文主要介绍在Windows平台下Git服务器的搭建,如下: 一:下载java,地址:http://www.java.com/zh_CN/ 二:安装Java.安装步骤不再详述. 三:配置Java环境变量. 右键 计算机->属性->高级系统设置->高级->环境变量->

Windows平台下Git服务器搭建

该文章转自:http://www.codeceo.com/article/windows-git-server.html 第一步:下载Java,下载地址:http://www.java.com/zh_CN/ 第二步:安装Java.安装步骤不再详述. 第三步:配置Java环境变量. 右键”计算机” => ”属性” => ”高级系统设置” => ”高级” => “环境变量” => “系统变量”. 新建: 变量名:JAVA_HOME 变量值:D:\Program Files (x8

Windows平台下React-Native开发环境搭建

React-Native是由Facebook开发的开源框架,主要用于开发原生APP,是新一代的在移动APP用户体验和Web开发效率间建立平衡点的新型技术.React-Native可以利用JavaScript语言快速开发出高质量的原生应用,正如其设计目标:“Learn Once,write anywhere”,程序员通过一次学习RN的核心技术便可以快速开发出IOS和Android移动应用.大大降低学习成本.由于Facebook的工程师团队大部分使用Mac进行开发,所以现阶段React-Native

《转》Windows平台下Git服务器搭建

该文章转自:http://www.codeceo.com/article/windows-git-server.html Windows平台下Git服务器搭建 第一步:下载Java,下载地址:http://www.java.com/zh_CN/ 第二步:安装Java.安装步骤不再详述. 第三步:配置Java环境变量. 右键”计算机” => ”属性” => ”高级系统设置” => ”高级” => “环境变量” => “系统变量”. 新建: 变量名:JAVA_HOME 变量值:D

Windows无法启动SQL server 代理服务(服务器)错误1067:进程意外终止

Windows无法启动SQL server 代理服务(服务器)错误1067:进程意外终止 解决办法: 将关联的sql server(实例) 服务停止. 然后启动sql server代理 服务.

windows平台下的oracle ORA-01031的解决方法

今天下午遇到一个很怪异的问题,在windows平台下sqlplus  / as sysdba登陆数据库,提示权限不足, 当时就纳闷了,sys用户登陆数据库还能权限不足,问题出现了,就开始寻找解决方法呗 首先查看$ORACLE_HOME/network/admin/sqlnet.ora中SQLNET.AUTHENTICATION_SERVICES项的配置信息, 网上的大多数帖子一致结论为: 在windows平台上,SQLNET.AUTHENTICATION_SERVICES必须设置为NTS或者AL

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

通过收集计数器信息,并将计数器信息汇总为不同粒度存储,以Reporting Service报表服务器显示.以下是计数器收集汇总的基本架构. 笔者需要收集的SQL Server计数器包括:SQL Server计数器属性详解 一.SQL Server计数器基本架构图 1. 生产服务器通过ODBC开发数据库互联ODBC配置访问监控监控服务器的SQLPerfData,将数据写入该数据库.详情请见计数器部署 SQL Server性能计数器部署(批量) 2. 通过作业调用存储过程spb_Perf_Count