SQL Server 2016 readtrace rml工具

问题描述 投票:1回答:2

我在SQL Server 2016探查器中捕获了一个跟踪文件,并希望使用readtrace和reporter来可视化SQL摘要。我可以在该RML安装中处理在SQL Server 2008中捕获的跟踪文件。但是,当我尝试处理2016跟踪文件时,我收到以下错误:

01/31/17 08:45:11.227 [0X00004628] Attempting DOD5015 removal of [c:\temp\traces\trc2_out\ReadTrace.log]
01/31/17 08:45:11.231 [0X00004638] I/O Completion manager started
01/31/17 08:45:11.256 [0X00004628] Readtrace a SQL Server trace processing utility.
Version 9.04.0051 built for x64.
Copyright ⌐ 1997-2014 Microsoft. All Rights Reserved
01/31/17 08:45:11.259 [0X00004628]             Computer: XXX
01/31/17 08:45:11.260 [0X00004628]          Base Module: C:\Program Files\Microsoft Corporation\RMLUtils\ReadTrace.exe
01/31/17 08:45:11.261 [0X00004628]           Process Id: 17956
01/31/17 08:45:11.262 [0X00004628]  Active proc mask(0): 0x00000001
01/31/17 08:45:11.263 [0X00004628]         Architecture: 9
01/31/17 08:45:11.264 [0X00004628]            Page size: 4096
01/31/17 08:45:11.265 [0X00004628]                 CPUs: 1
01/31/17 08:45:11.265 [0X00004628]     Processor groups: 1
01/31/17 08:45:11.266 [0X00004628]         Highest node: 0
01/31/17 08:45:11.269 [0X00004628]   Proximity: 00  Node: 00
01/31/17 08:45:11.270 [0X00004628] ---------------------------------------
01/31/17 08:45:11.271 [0X00004628]                Group: 0
01/31/17 08:45:11.272 [0X00004628] ---------------------------------------
01/31/17 08:45:11.273 [0X00004628]         Package mask: 0x00000001
01/31/17 08:45:11.273 [0X00004628]         Processor(s): 0x00000001 Function units: Separated
01/31/17 08:45:11.274 [0X00004628]         Processor(s): 0x00000001 assigned to Numa node: 0
01/31/17 08:45:11.275 [0X00004628] Current time bias: -60 minutes -1.00 hours DST Standard
01/31/17 08:45:11.276 [0X00004628] -Itrc2c.trc
01/31/17 08:45:11.277 [0X00004628] -otrc2_out
01/31/17 08:45:11.280 [0X00004628] -SXXX\XXX
01/31/17 08:45:11.318 [0X00004628] Using language id (LCID): 1024 [English_United States.1252] for character formatting with NLS: 0x0006020E and Defined: 0x0006020E
01/31/17 08:45:11.321 [0X00004628] Attempting to cleanup existing RML files from previous execution
01/31/17 08:45:11.322 [0X00004628] Using extended RowsetFastload synchronization
01/31/17 08:45:11.323 [0X00004628] Establishing initial database connection
01/31/17 08:45:11.323 [0X00004628] Server: XXX\XXX
01/31/17 08:45:11.324 [0X00004628] Database: PerfAnalysis
01/31/17 08:45:11.325 [0X00004628] Authentication: Windows
01/31/17 08:45:11.385 [0X00004628] Using SQLOLEDB version 11.0.6518.0
01/31/17 08:45:11.394 [0X00004628] Connected to SQL Server Version, Major: 13, Minor: 0, Build: 4001
01/31/17 08:45:11.395 [0X00004628] Creating or clearing the performance database
01/31/17 08:45:11.759 [0X00004628] The major version number (13) in the trace file header is not a supported file version.
01/31/17 08:45:11.763 [0X00004628] ERROR: Read of file header for file c:\temp\traces\trc2c.trc failed with operating system error 0x8007000D (The data is invalid)

似乎跟踪文件的格式不正确,readtrace无法处理。这有解决方案吗?有没有其他方法如何获得有关我的跟踪文件的统计概述?我知道不推荐使用跟踪文件,而应该使用扩展事件。扩展事件现在不是一个选项。

sql-server trace
2个回答
0
投票

需要修改跟踪文件的标头以供ReadTrace处理。我使用找到here的powershell代码。

## =============================================
## Author:      Gianluca Sartori - @spaghettidba
## Create date: 2012-11-07
## Description: Changes the version information
##              in the header of a SQL Server trace
## =============================================
cls

# Enter your filename here
$fileName = "somefile.trc"

# The version information we want to write: 0x0A = 10 = SQLServer 2008
[Byte[]] $versionData = 0x0A
# The offset of the version information in the file
$offset = 390

[System.IO.FileMode] $open = [System.IO.FileMode]::OpenOrCreate
$stream = New-Object System.IO.FileStream -ArgumentList $fileName, $open
$stream.Seek($offset, [System.IO.SeekOrigin]::Begin);
$stream.Write($versionData, 0, $versionData.Length);
$stream.Close()

0
投票

来自https://github.com/Microsoft/SqlNexus/issues/49

suresh-kandoth在6月3日发表评论要获得可以处理SQL Server 2016和2017跟踪文件或XEL文件的ReadTrace版本,请按照下列步骤操作:

https://www.microsoft.com/en-us/download/details.aspx?id=54090下载数据库实验助手(DEA)安装DEA工具集。使用的默认路径是“C:\ Program Files(x86)\ Microsoft Corporation \ Database Experimentation Assistant”如果您查看文件夹“C:\ Program Files(x86)\ Microsoft Corporation \ Database Experimentation Assistant \ Dependencies \ X64”,您将注意最新版本的ReadTrace。从C:\ Program Files \ Microsoft Corporation \ RMLUtils制作现有ReadTrace和其他相关文件的备份副本从“C:\ Program Files(x86)\ Microsoft Corporation \ Database Experimentation Assistant \ Dependencies \ X64”复制4个文件到“C:\ Program Files \ Microsoft Corporation \ RMLUtils”并覆盖现有文件。现在,您应该能够使用较新版本的ReadTrace处理SQL Server 2016和2017的跟踪文件。拥有ReadTrace实用程序的团队有一个操作项,用于使用这些新二进制文件更新/刷新RML的下载位。没有关于何时可用的预计日期。

© www.soinside.com 2019 - 2024. All rights reserved.