SQL Server 之RML Utilities 分析SQL Server性能
一:概述 RML Utilities
- RML(Replay Markup Language)是MS SQL Server产品支持服务团队内部开发使用的一个Trace分析工具,最新的版本支持SQL Server 2005和SQL Server 2008。
- 功能:
- 分析最占资源的应用和查询。
- 分析跟踪期间的查询计划变更的情况。
- 分析哪些查询比起以前来说变慢了
二: RML Utilities suite
三:RML Utilities的The Performance Cycle
四:准备RML Utilities
- 官方提供 RML Utilities使用的条件:
- The setup (RMLSetup*.msi) is Windows MSI based.
- Native setup is provided for individual processor architectures.
- Run the MSI that is appropriate for your processor. Use the
- AMD64 MSI for x64 installations.
- You must uninstall any previous installation before installing another version.
- On systems with UAC you must run setup with elevated permissions.
- This is required for registration of the ORCA COM
- object. Setup will prompt you for elevated permissions.
- 下载软件包http://blogs.msdn.com/psssql/archive/2008/11/12/cumulative-update-1-to-the-rml-utilities-for-microsoft-sql-server-released.aspx
- RML Utilities默认安装位置"Program Files\Microsoft Corporation\RMLUtils" ,
- 如果需要请调整window的环境变量,添加RML Utilities的路径
- 系统中必须安装SQL Server 2005及其以上版本
- 你已经创建了文件目录c:\temp,用于临时文件的存储(.log格式)
- 确保已获取.trc格式的跟踪文件
执行C:\Program Files或者Program Files(86)\Microsoft SQL Server\90\Tools\Binn\SQLdiag.exe(如果没有执行过SQLdiag.exe)
- copy
- "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\SD_Detailed.xml" 到
- "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\PPConfig.xml" (将SD_Detailed.xml负责一个副本并重命名为PPConfig.xml)
- 修改PPConfig.xml,将<ProfilerCollector enabled="true" 改为<ProfilerCollector enabled="false"
五:开始RML Utilities分析
- 打开RML Cmd Prompt工具执行命令
- ReadTrace -IE:\13\13.trc(跟踪文件路径) -oc:\temp\PPBreakout(临时存储文件路径) -S(local) -d database_name(也可以不指定临时数据库)
- 命令执行结果如下:
- 接下来我们就可以根据上面的图形展示,分析SQL Server的性能问题
- 另提供RML Utilities官方使用文档,请下载参考。
转载于:https://blog.51cto.com/haicang/1132462