2017-01-31 75 views
1

我已經在SQL Server 2016分析器中捕獲了一個跟蹤文件,並希望使用readtrace和reporter來可視化SQL摘要。我可以處理在該RML安裝中在SQL Server 2008中捕獲的跟蹤文件。然而,當我嘗試處理2016年跟蹤文件我得到以下錯誤:SQL Server 2016 readtrace rml工具

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處理的格式不正確。有沒有解決方案?有沒有其他方法來獲得我的跟蹤文件的統計概覽?我知道跟蹤文件已被棄用,應該使用擴展事件。擴展事件現在不是一個選項。

+0

你爲什麼試圖在2008工具中使用2016跟蹤文件?你有沒有下載[最新版本?]。此外,Profiler本身已被棄用,你想要什麼可以通過dmvs,擴展事件和已經是SQL Server的一部分的報告 –

+1

我已經安裝了https://www.microsoft.com/en-us/download/confirmation.aspx ?id = 4511這是最新版本。 –

回答

0

需要修改跟蹤文件的標題以供ReadTrace處理。我使用找到的的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()