RML Utilities for SQL Server工具

今天学习了一下RML Utilities工具,觉得这个工具确实比较好的跟SQL Server Profiler工具结合起来使用,确实挺好的。工具的下载地址
        SQL Server 的重播标记语言 (RML) 实用程序:https://support.microsoft.com/zh-cn/kb/944837
        RML Utilities for SQL Server (x86) –  https://www.microsoft.com/en-us/download/details.aspx?id=8161
        RML Utilities for SQL Server (x64) –  https://www.microsoft.com/en-us/download/details.aspx?id=4511

有些机器会提示安装:Microsoft ReportViewer--https://www.microsoft.com/zh-CN/download/confirmation.aspx?id=35747

我下载的是x64版本的,在使用该先要有个trc文件,让用用该工具进行分析trc文件,下面是操作步骤

        STEP1:生成trc文件

        开启SQL SERVER PROFILER, 对服务起进行跟踪一段时间,生成a.trc 文件,将文件放在D盘根目录下面: G:\a.trc

        STEP2:打开RML Utilities Command Prompt工具
       该工具在:开始-->所有程序-->RML Utilities for SQL Server-->RML Cmd Prompt" 或者进入安装目录(我的安装目录是:C:\Program Files\Microsoft Corporation\RMLUtils),打开的界面如图:
     

STEP3:开启本地SQL server 服务
     我装的是SQL SERVER 2012, 当然也可以通过参数配置指定远程服务器,只要指定的用户有响应的权限。

STEP4:运行导入命名     
     先要创建输出目录D:\trace

  1. [RML] D:\\Program Files\\Microsoft Corporation\\RMLUtils>ReadTrace -I"G:\a.trc" -o"G:\trace" -S"127.0.0.1\RTWO2" -d"crm" -E -U"sa" -P"******"

具体参数说明(-I:输入文件,-o:输出文件,-S:服务器,-d:数据库,-E:windows认证),下面会介绍, 输出结果如下


[RML] D:\\Program Files\\Microsoft Corporation\\RMLUtils>ReadTrace -I"G:\a.trc" -o"G:\trace" -S"127.0.0.1\RTWO2" -d"crm" -E -U"sa" -P"******"

06/05/16 15:44:12.525 [0X000007A4] I/O Completion manager started
06/05/16 15:44:12.525 [0X00001304] Attempting DOD5015 removal of [G:\trace\Read
06/05/16 15:44:12.527 [0X00001304] Readtrace a SQL Server trace processing util
Version 9.04.0051 built for x64.
Copyright ? 1997-2014 Microsoft. All Rights Reserved
06/05/16 15:44:12.527 [0X00001304] Computer: 127.0.0.1
06/05/16 15:44:12.527 [0X00001304] Base Module: C:\Program Files\Micro
06/05/16 15:44:12.527 [0X00001304] Process Id: 7296
06/05/16 15:44:12.527 [0X00001304] Active proc mask(0): 0x000000FF
06/05/16 15:44:12.527 [0X00001304] Architecture: 9
06/05/16 15:44:12.527 [0X00001304] Page size: 4096
06/05/16 15:44:12.527 [0X00001304] CPUs: 8
06/05/16 15:44:12.527 [0X00001304] Processor groups: 1
06/05/16 15:44:12.527 [0X00001304] Highest node: 0
06/05/16 15:44:12.528 [0X00001304] Proximity: 00 Node: 00
06/05/16 15:44:12.528 [0X00001304] ---------------------------------------
06/05/16 15:44:12.528 [0X00001304] Group: 0
06/05/16 15:44:12.528 [0X00001304] ---------------------------------------
06/05/16 15:44:12.528 [0X00001304] Processor(s): 0x00000003 Function un
06/05/16 15:44:12.528 [0X00001304] Processor(s): 0x0000000C Function un
06/05/16 15:44:12.528 [0X00001304] Processor(s): 0x00000030 Function un
06/05/16 15:44:12.528 [0X00001304] Package mask: 0x000000FF
06/05/16 15:44:12.528 [0X00001304] Processor(s): 0x000000C0 Function un
06/05/16 15:44:12.528 [0X00001304] Processor(s): 0x000000FF assigned to
06/05/16 15:44:12.529 [0X00001304] Current time bias: -480 minutes -8.00 hours
06/05/16 15:44:12.529 [0X00001304] -IG:\a.trc
06/05/16 15:44:12.533 [0X00001304] -oG:\trace
06/05/16 15:44:12.535 [0X00001304] -S127.0.0.1\RTWO2
06/05/16 15:44:12.541 [0X00001304] -dcrm
06/05/16 15:44:12.544 [0X00001304] -E
06/05/16 15:44:12.546 [0X00001304] -Usa
06/05/16 15:44:12.549 [0X00001304] -P******
06/05/16 15:44:12.551 [0X00001304] Using language id (LCID): 1024 [Chinese (Sim
06/05/16 15:44:12.557 [0X00001304] Attempting to cleanup existing RML files fro
06/05/16 15:44:12.560 [0X00001304] Using extended RowsetFastload synchronizatio
06/05/16 15:44:12.562 [0X00001304] Establishing initial database connection
06/05/16 15:44:12.564 [0X00001304] Server: 127.0.0.1\RTWO2
06/05/16 15:44:12.567 [0X00001304] Database: crm
06/05/16 15:44:12.569 [0X00001304] Authentication: SQL
06/05/16 15:44:12.604 [0X00001304] Using SQLOLEDB version 11.0.2100.60
06/05/16 15:44:12.605 [0X00001304] Connected to SQL Server Version, Major: 10,
06/05/16 15:44:12.606 [0X00001304] Creating or clearing the performance databas
06/05/16 15:44:14.878 [0X00001304] Processing file: G:\a.trc (
06/05/16 15:44:14.884 [0X00001304] Validating core events exist
06/05/16 15:44:14.886 [0X00001304] WARNING: The ‘EventSequence‘ column for even
06/05/16 15:44:14.888 [0X00001304] WARNING: The ‘EventSequence‘ column for even
06/05/16 15:44:14.891 [0X00001304] WARNING: The ‘EventSequence‘ column for even
06/05/16 15:44:14.894 [0X00001304] WARNING: The ‘EventSequence‘ column for even
06/05/16 15:44:14.898 [0X00001304] WARNING: The ‘EventSequence‘ column for even
06/05/16 15:44:14.902 [0X00001304] WARNING: The ‘EventSequence‘ column for even
06/05/16 15:44:14.904 [0X00001304] WARNING: The ‘EventSequence‘ column is missi
06/05/16 15:44:14.907 [0X00001304] Validating necessary events exist for analys
06/05/16 15:44:14.910 [0X00001304] WARNING: The following trace events were not
06/05/16 15:44:14.912 [0X00001304] WARNING: Event 10 (POST_RPC_EVENT_CLASS) doe
06/05/16 15:44:14.915 [0X00001304] WARNING: Event 12 (POST_LANG_EVENT_CLASS) do
06/05/16 15:44:14.917 [0X00001304] WARNING: Event 13 (PRE_LANG_EVENT_CLASS) doe
06/05/16 15:44:14.920 [0X00001304] WARNING: The quality of the performance anal
06/05/16 15:44:14.925 [0X00001304] Validating necessary events exist for RML br
06/05/16 15:44:14.927 [0X00001304] WARNING: Event [Server: Server Memory Change
06/05/16 15:44:14.930 [0X00001304] WARNING REPLAY: The following trace events w
arnings:Attention, Transactions:SQLTransaction, Transactions:DTCTransaction, Tr
ompleted, Transactions:TM:Save Tran starting, Transactions:TM:Save Tran complet
replay needs. Lack of these events can lead to severe replay problems.
06/05/16 15:44:14.934 [0X00001304] ERROR: RML output has been disabled because

Trace flag -T28 disables the check allowing RML output processing. *** Use with
06/05/16 15:44:15.212 [0X00001304] Events Read: 1000 Queued: 346 Processed/sec:
06/05/16 15:44:15.215 [0X00001304] ********************************************
06/05/16 15:44:15.215 [0X00001304] WARNING: Found [TRACE_PAUSE_EVENT] in trace
06/05/16 15:44:15.215 [0X00001304] To process further events extract them with
06/05/16 15:44:15.215 [0X00001304] ********************************************
06/05/16 15:44:15.241 [0X00001304] Reads completed
06/05/16 15:44:15.241 [0X00001304] Signaling worker threads to complete final a
06/05/16 15:44:15.243 [0X00001304] Waiting for the worker threads to complete f
06/05/16 15:44:15.250 [0X00001304] Performing general cleanup actions.
06/05/16 15:44:15.250 [0X00001304] Reducing cached memory in background
06/05/16 15:44:15.251 [0X00001304] Total Events Processed: 1088
06/05/16 15:44:15.251 [0X00001304] Total Events Filtered: 0
06/05/16 15:44:15.262 [0X00001304] Table ReadTrace.tblUniqueBatches: loaded ~13
06/05/16 15:44:15.262 [0X00001304] Table ReadTrace.tblUniqueStatements: loaded
06/05/16 15:44:15.263 [0X00001304] Table ReadTrace.tblUniquePlans: loaded ~0 ro
06/05/16 15:44:15.265 [0X00001304] Table ReadTrace.tblUniquePlanRows: loaded ~0
06/05/16 15:44:15.272 [0X00001304] Table ReadTrace.tblBatches: loaded ~571 rows
06/05/16 15:44:15.273 [0X00001304] Table ReadTrace.tblStatements: loaded ~0 row
06/05/16 15:44:15.276 [0X00001304] Table ReadTrace.tblPlans: loaded ~0 rows
06/05/16 15:44:15.278 [0X00001304] Table ReadTrace.tblPlanRows: loaded ~0 rows
06/05/16 15:44:15.281 [0X00001304] Table ReadTrace.tblInterestingEvents: loaded
06/05/16 15:44:15.286 [0X00001304] Table ReadTrace.tblConnections: loaded ~336
06/05/16 15:44:15.295 [0X00001304] WARNING: One or more warning conditions exis
06/05/16 15:44:15.298 [0X00001304] INFO: Cleaning up unique batch hash table
06/05/16 15:44:15.299 [0X00001304] INFO: Cleaning up unique statement hash tabl
06/05/16 15:44:15.300 [0X00001304] INFO: Cleaning up unique plan hash table
06/05/16 15:44:15.301 [0X00001304] INFO: Cleaning up unique procedure hash tabl
06/05/16 15:44:15.303 [0X00001304] Indexing tables...
06/05/16 15:44:15.937 [0X00001304] Doing post-load data cleanup...
06/05/16 15:44:16.413 [0X00001304] Computing partial aggregates...
06/05/16 15:44:16.826 [0X00001304] Building analysis indexes ...
06/05/16 15:44:16.842 [0X00001304] Data load completed.
06/05/16 15:44:16.843 [0X00001304] Using execution path: C:\Program Files\Micro
06/05/16 15:44:16.846 [0X00001304] Launching [C:\Program Files\Microsoft Corpor
06/05/16 15:44:16.885 [0X00001304] Launch failure exit code: 259
06/05/16 15:44:16.885 [0X00001304] Attempt to launch Reporter failed. Check th
06/05/16 15:44:16.887 [0X00001304] ********************************************
* ReadTrace encountered one or more ERRORS. An error condition typically *
* stops processing early and the ReadTrace output may be unusable. *
* Review the log file for details. *
*******************************************************************************
06/05/16 15:44:16.890 [0X00001304] ***** ReadTrace exit code: -23
06/05/16 15:44:16.931 [0X00001304]
06/05/16 15:44:16.933 [0X00001304] INFO: Cleaning up unique batch hash table
06/05/16 15:44:16.933 [0X00001304] INFO: Cleaning up unique statement hash tabl
06/05/16 15:44:16.934 [0X00001304] INFO: Cleaning up unique plan hash table
06/05/16 15:44:16.935 [0X00001304] INFO: Cleaning up unique procedure hash tabl
06/05/16 15:44:16.935 [0X00001304] INFO: Cleaning up connection info hash table

     STEP5:查看报表
     上面的第4步完成后,会自动打开Reporter应用程序

通过报表,可以看到你的跟踪在跟踪这段时间内服务器的相关压力情况,具体每个界面就不一一截图了。

     STEP6: 本地数据库MID中增加了对象
     执行第4步的命令时,会在参数-d配置的 MID数据库中创建一些对象

下面是ReadTrace中的一些参数说明:

USAGE:
        NOTE: All command line arguments are case sensitive

-- 输入文件
-I  File name of the first .TRC or .XEL file to process [REQUIRED].  Note:  XEL
processing is ‘BETA‘ and limited.

-- 文件在压缩文件内
-i  If specified, indicates that the .TRC file(s) to process are present inside
a CAB/ZIP/RAR file with this file name

-- 输出文件(要全路径的),默认是当前目录
-o  Full path of directory to place output files [default is current directory]

--数据库服务器(生成的数据库对象保存在该服务器上),默认local
-S  Name of SQL Server 2005 server to connect to when loading performance analys
is data [default is (local)]

--指定数据库(用与存放分析的数据),未指定会创建PerfAnalysis数据库
-d  Database to use when loading performance data [default is PerfAnalysis].
    User specified below must have CREATE DATABASE permission (if DB doesn‘t
    exist) or be part of the db_owner role if the database already exists.

-- 登录数据库服务器为windows授权模式
-E  Connect to SQL using Windows Authentication [default]

--登录数据库服务器的用户
-U  Connect to SQL using this user name

--登录数据库服务器的密码
-P  Password for the user specified in -U option

-- 禁用执行分析
-a  Disable performance analysis

-f  Do not produce .RML output files for each Session and Request
-Q  Do normalization parse using quoted_identifier OFF symantics.  (Default is O
N)
-r# Read at most this # of files (including the first) [default is all files
    until a break in the rollover file sequence is detected].
-M  Mirror trace events by Session to the specified output directory (All Sessio
ns
    will be output even if Session filter is specified)
-MF Mirror trace events by Session to the specified output directory (Only Sessi
ons
   matching filter parameters will be output)
-MS Mirror trace events to a single .TRC file in the specified output directory.

-M[FS] or -M[SF] Combine mirror filtering with single .TRC file output
    *** NOTE: The mirroring option may be overwritten because the source metadat
a information indicates such a change. ***
-A  ‘INCLUDE or EXCLUDE‘ events with Application Names
-C  ‘INCLUDE or EXCLUDE‘ events with Database Names when possible
-H  ‘INCLUDE or EXCLUDE‘ events with Host Names
-s# ‘INCLUDE or EXCLUDE‘ events from specified Sessions
-X# ‘INCLUDE or EXCLUDE‘ events based on Event Class value
-x# ‘INCLUDE or EXCLUDE‘ events based on SubClass value
-B### Time bias: Adjusts the start and end times, as read by (+-)### minutes.
-b  Provide a designated start time in required format 2000-05-25 11:46:20:060
-e  Provide a designated stop time in required format  2000-05-25 11:46:20:060
-D  Skip date on log file output
-L  Integer value representing the language id
-Y  Optional scratch path used by Expander when handling compressed files.  If y
ou processing lots of files from a nested archive this can increase performance.

-?  Show usage of command line parameters

EXAMPLES:
ReadTrace -Iserver__sp_trace.trc -ic:\temp\traces.cab -oc:\temp\output -f
ReadTrace -I"c:\my traces\80AllEvents.trc" -o"c:\my output"
ReadTrace -Ioutput\SQLSRV1__sp_trace_20.trc -ic:\temp\pssdiag.zip -oc:\temp\brea
kout -f -r2
NOTE: Command line parameters must start with hyphen or slash and must not have
a space between the switch and parameter value.

时间: 2024-10-06 00:35:46

RML Utilities for SQL Server工具的相关文章

Windows10中“SQL Server 配置管理器”哪去了?

SQL Server 配置管理器是一种工具,用于管理与 SQL Server 相关联的服务.配置 SQL Server 使用的网络协议以及从 SQL Server 客户端计算机管理网络连接配置.SQL Server 配置管理器是一种可以通过“开始”菜单访问的 Microsoft 管理控制台管理单元,也可以将其添加到任何其他 Microsoft 管理控制台的显示界面中.Microsoft 管理控制台 (mmc.exe) 使用 Windows System32 文件夹中的 SQLServerMana

SQL Server 2012笔记分享-4:理解SQL server实例

每个单独的SQL server实例都有一个windows进程:sqlservr.exe,一个windows下能安装多个实例,多个实例会有多个sqlservr.exe进程. 一个SQL实例在后台对应一个服务,如果多个应用程序放在一个实例里,如果某个应用开发的程序有问题,比如死循环,会导致服务停止,从而导致所有数据库无法工作.可以采用多实例分开方式. 一个服务器上可以装多个实例,标准版(16个)和企业版(50个)支持的实例数量不同. SQL server实例的类型 (一)默认实例和命名实例 1.服务

SQL server 数据库用户表名称

转自(http://blog.163.com/jlj_sk/blog/static/22579293200861422833924/) 取得SQL server 数据库中 所有用户表名称 select name from sysobjects where xtype='U' order by name SQL server数据库系统表详解: sysaltfiles 主数据库 保存数据库的文件 syscharsets 主数据库字符集与排序顺序 sysconfigures主数据库 配置选项 sysc

ms sql server 系统表详细说明

sysaltfiles  主数据库 保存数据库的文件 syscharsets  主数据库字符集与排序顺序 sysconfigures 主数据库 配置选项 syscurconfigs 主数据库当前配置选项 sysdatabases 主数据库服务器中的数据库 syslanguages 主数据库语言 syslogins 主数据库 登陆帐号信息 sysoledbusers 主数据库 链接服务器登陆信息 sysprocesses 主数据库进程 sysremotelogins主数据库 远程登录帐号 sysc

SQL SERVER 临时表导致存储过程重编译(recompile)的一些探讨

SQLSERVER为了确保返回正确的值,或者处于性能上的顾虑,有意不重用缓存在内存里的执行计划,而重新编译执行计划的这种行为,被称为重编译(recompile).那么引发存储过程重编译的条件有哪一些呢?下面罗列了一些导致重编译(recompile)的条件:     - 对查询所引用的表或视图进行更改(ALTER TABLE 和 ALTER VIEW).     - 对执行计划所使用的任何索引进行更改.     - 对执行计划所使用的统计信息进行更新,这些更新可能是从语句(如 UPDATE STA

微软ASP.NET站点部署指南(2):部署SQL Server Compact数据库

1. 综述 对于数据库访问,Contoso University程序要求下面的软件必须随程序一起部署,因为不属于.NET Framework: SQL Server Compact (数据库引擎) ASP.NET Universal Providers (启用ASP.NET membership以使用SQL Server Compact) Entity Framework 4.1 (Code First) 2个数据库的数据库结构和相关的一些数据都需要部署.通常,开发系统的时候都会有一些测试数据,

【转】SQL Server与Oracle的区别

转自:http://soft.chinabyte.com/database/255/12258255.shtml SQL Server与Oracle的区别 2012-02-10 00:00 中国IT实验室 佚名 关键字:Oracle 随着信息技术的飞速发展,数据处理不仅在数量上要求越来越大,而且在质量上也要求越来越高.Oracle数据库在大多数企业中受到广泛使用,而SQL Server数据库也因为和Windows的联系,在企业中的使用也是非常广泛. 操作系统的稳定对数据库来说是十分紧要的,在数据

SQL SERVER系统表和常用函数介绍

sysaltfiles 主数据库 保存数据库的文件 syscharsets 主数据库 字符集与排序顺序sysconfigures 主数据库 配置选项syscurconfigs 主数据库 当前配置选项sysdatabases 主数据库 服务器中的数据库syslanguages 主数据库 语言syslogins 主数据库 登陆帐号信息sysoledbusers 主数据库 链接服务器登陆信息sysprocesses 主数据库 进程 sysremotelogins主数据库 远程登录帐号syscolumn

微软ASP.NET网站部署指南(2):部署SQL Server Compact数据库

1. 综述 对于数据库訪问,Contoso University程序要求以下的软件必须随程序一起部署.由于不属于.NET Framework: SQL Server Compact (数据库引擎) ASP.NET Universal Providers (启用ASP.NET membership以使用SQL Server Compact) Entity Framework 4.1 (Code First) 2个数据库的数据库结构和相关的一些数据都须要部署.通常.开发系统的时候都会有一些測试数据,