November 18, 2008 at 7:19 am
Hi,
When I try to create a new trace I keep getting the error message "Msg 19067, Level 16, State 1, Procedure sp_trace_create, Line 1
Cannot create a new trace because the trace file path is found in the existing traces."
If I change the trace file name then it works but I want to programatically set the filename to something like 'trace_date_time' but it only seems to allow one trace to be named before you have to change the start of the trace filename. I also can't delete the old trace files from the file system or remove them from sys.traces. I can only set the status to zero.
Any help would be much appreciated.
Thanks.
November 18, 2008 at 7:29 am
Create a random file name each time when you start your trace, this will solve the problem 🙂
November 18, 2008 at 8:43 am
Thanks but not very useful when trying to remember what the file is a few months down the line! This was working until yesterday so I don't know what's stopping it from working now.
November 18, 2008 at 9:53 am
Why cant u crate a file name with dates on it that will be helpful to identify the files after a few days or months, there is a option in trace, to create a new file after the current file has reached a size, i think that this is the problem, when it tries to create a file name, the file already exists. 🙂
November 18, 2008 at 10:53 am
to delete a trace you have to stop and close it
exec sp_trace_setstatus traceid, 0 --stop trace
exec sp_trace_setstatus traceid, 2 --close trace
all of this is no good until you know the traceid, get this by using
select * from ::fn_trace_getinfo(default)
each active trace will return 5 five rows, property 5 indicates started, stopped or closed
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
November 19, 2008 at 1:26 am
Thanks Perry! That was it. I was stopping the trace but not closing it.
November 19, 2008 at 5:47 am
your welcome
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply