2010-12-14 68 views
1

在调用exec之前,会导致服务器端跟踪消失什么sp_trace_setstatus @TraceID,2?SQL Server 2008,服务器端跟踪消失

在本地数据库上,我使用SQL事件探查器导出服务器端跟踪定义。 我设置文件名和运行生成的脚本和跟踪显示为在

预期
SELECT * FROM ::fn_trace_getinfo(default) 

然而,在我的测试工具完成,fn_get_traceinfo显示了跟踪已经消失,只保存跟踪文件中的第一个匹配一半的数据库工作量。 没有错误被抛出,无论我使用什么跟踪模板,我都可以得到相同的结果。 @@ version是Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) Apr 2 2010 15:48:46 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600:)

谢谢。

回答

1

在事件日志中,我发现

Trace ID '2' was stopped because of an error. Cause: Stopping the trace because the current trace file is full and the rollover option is not specified.. Restart the trace after correcting the problem. 

在跟踪定义的顶部是一个@maxfilesize变量,凹凸htat和问题就解决了。