1.跟踪标记用于临时设置特定服务器的特征和关闭特定行为。跟踪标记经常用于诊断性能问题,或调试存储过程或复杂的计算机系统。
(1)启用指定的跟踪标记。
DBCC TRACEON ( trace# [ ,...n ][ , -1 ] ) [ WITH NO_INFOMSGS ]
(2)禁用指定的跟踪标记。
DBCC TRACEOFF ( trace# [ ,...n ] [ , -1 ] ) [ WITH NO_INFOMSGS ]
(3)显示跟踪标志的状态。
DBCC TRACESTATUS ( [ [ trace# [ ,...n ] ] [ , ] [ -1 ] ] ) [ WITH NO_INFOMSGS ]
DBCC TRACEON ( trace# [ ,...n ][ , -1 ] ) [ WITH NO_INFOMSGS ]
(2)禁用指定的跟踪标记。
DBCC TRACEOFF ( trace# [ ,...n ] [ , -1 ] ) [ WITH NO_INFOMSGS ]
(3)显示跟踪标志的状态。
DBCC TRACESTATUS ( [ [ trace# [ ,...n ] ] [ , ] [ -1 ] ] ) [ WITH NO_INFOMSGS ]
实例:dbcc tracestatus(3205,-1)