Trace File Overwrite?

  • Hi there!  We have a trace going and realized that it is basically turning itself off once it hits the max file size and file number count.  Is there an automated way to make the trace just start overwriting the oldest records?  Or do I have to create some sort of cleanup job to go delete one of the files when it hits the max file size?

  • Something like that can be achieved, by using Rollover option, and using parameter @filecount while using the proc sp_trace_create. It will basically delete the oldest file if the maximum number of rollover files has been reached. You can find more here by Kalen Delaney:

    http://sqlblog.com/blogs/kalen_delaney/archive/2007/06/29/did-you-know-a-6th-parameter-when-creating-a-trace.aspx

  • Odd I have that set though... I have the max file size set, the number of rollover files set to 2... and the second parameter is set to 6.

  • amy26 - Thursday, August 10, 2017 12:04 PM

    Odd I have that set though... I have the max file size set, the number of rollover files set to 2... and the second parameter is set to 6.

    If it's set correctly, it could be that the file is in use - it won't be deleted if that is the case. Maybe try to set the trace files to a folder that can be excluded by antivirus.

    Sue

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply