gpt4 book ai didi

sql-server - 在 SQL Server 中,如何将多个 .trc 文件移动/导入到跟踪表

转载 作者:行者123 更新时间:2023-12-02 02:58:44 25 4
gpt4 key购买 nike

我有一组使用 Sql Profiler 记录的翻转 .trc 文件。

mytrace.trc

mytrace_1.trc

mytrace_2.trc

mytrace_3.trc

我可以使用此命令导入第一个:

use [my-database]
SELECT * INTO trace_folder
FROM::fn_trace_gettable('C:\mytrace.trc', 4)

但是,这似乎只加载第一个文件,而不是全部四个文件。

最佳答案

您需要使用 fn_trace_gettable:

来自http://msdn.microsoft.com/en-us/library/ms188425.aspx :

USE AdventureWorks;
GO
SELECT * INTO temp_trc
FROM fn_trace_gettable('c:\temp\mytrace.trc', default);
GO

此外,文档中的警告:

Be aware that the fn_trace_gettable function will not load rollover files (when this option is specified by using the number_files argument) where the original trace file name ends with an underscore and a numeric value. (This does not apply to the underscore and number that are automatically appended when a file rolls over.) As a workaround, you can rename the trace files to remove the underscores in the original file name. For example, if the original file is named Trace_Oct_5.trc and the rollover file is named Trace_Oct_5_1.trc, you can rename the files to TraceOct5.trc and TraceOct5_1.trc.

关于sql-server - 在 SQL Server 中,如何将多个 .trc 文件移动/导入到跟踪表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2784714/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com