February 16, 2011 at 11:19 am
declare @rc int
declare @TraceID int
declare @maxfilesize bigint
declare @filecount int
set @maxfilesize = 50 /* The size of each file is 50 Mb.*/
set @filecount = 5
-- Please replace the text InsertFileNameHere, with an appropriate
-- filename prefixed by a path, e.g., c:\MyFolder\MyTrace. The .trc extension
-- will be appended to the filename automatically. If you are writing from
-- remote server to local drive, please use UNC path and make sure server has
-- write access to your network share
exec @rc = sp_trace_create @TraceID output, 0, N'\\servername\D$\Folder\Trace_1', @maxfilesize, NULL, @filecount
what's wrong in the above script? PLS suggest!
Thanks.
February 16, 2011 at 11:59 am
What response are you getting that is telling you you can't create RollOver files? Post the exact error message (type or cut-n-paste) please.
February 16, 2011 at 12:04 pm
Your second parameter, which is 0, should be set to 2, which enables rollover.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 16, 2011 at 12:09 pm
Hi Grant/Brandie,
exec @rc = sp_trace_create @TraceID output, 2,
N'\\system-namet\E$\Trace\Trace_1', @maxfilesize, NULL,@filecount;
if (@rc != 0) goto error
Getting the below error msg:
Msg 19069, Level 16, State 1, Procedure sp_trace_create, Line 1
The trace file name is not valid because it contains a rollover file number (NNN in C:\file_NNN) while the trace rollover option is enabled.
(1 row(s) affected)
Thanks.
February 16, 2011 at 12:15 pm
February 16, 2011 at 12:21 pm
Brandie Tarvin (2/16/2011)
SQL is assuming the _1 is forcing a trace number. Remove it.
exec @rc = sp_trace_create @TraceID output, 0, N'\\servername\D$\Folder\Trace_1', @maxfilesize, NULL, @filecount
Should be
exec @rc = sp_trace_create @TraceID output, 0, N'\\servername\D$\Folder\Trace', @maxfilesize, NULL, @filecount
Absolutely, what she said. SQL Server manages that stuff for you.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply