August 30, 2007 at 7:46 am
Hi all
I've setup blackboxtrace on my servers a few months ago based on this article
http://www.sqlservercentral.com/columnists/bknight/blackbox.asp
Does anyone know how to stop this trace without restarting SQL Server?
Thank you
August 30, 2007 at 7:53 am
You can stop a trace with the stored procedure sp_trace_setstatus.
In order to use it you first need to find the traceid of the blackbox trace.
Run "SELECT * FROM :: fn_trace_getinfo(default) " which return info about all running traces and when use the trace id and run "Exec sp_trace_setstatus @traceid, 0" to stop the trace.
Markus
[font="Verdana"]Markus Bohse[/font]
August 30, 2007 at 8:19 am
MarkusB
SELECT * FROM :: fn_trace_getinfo(default)
This query did not return anything.
It's was weird because i still saw the blackbox.trc and blackbox_1.trc files in datafiles folder and they were being cycled.
I did run this script to start the trace
-- Create a procedure
-- to call sp_trace_create
create procedure StartBlackBoxTrace
as
declare @tid int
exec sp_trace_create @tid output, 8
exec sp_trace_setstatus @tid, 1
GO
So then i ran your recommended proc sp_trace_setstatus 8, 0 and now blackbox.trc and blackbox_1.trc files stopped cycling.
Thanks MarkusB
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply