Possible to alter a server-side trace without deleting and re-creating?

  • On the servers I'm now responsible for, the previous DBA implented a server-side trace. This trace logs quite a bit, allows the files on disk to grow to 1GB, and keeps 5000(!) files.

    Well, the servers don't have 5TB drives (I wonder if they had intended to have 1MB files) so I've been having to go in to delete old files to keep them from filling up whatever drive they're getting saved to.

    What I'd like to do is, alter the trace to either keep the files to 1MB (maybe 10MB), or keep (a LOT) fewer files (maybe only 50 or so)

    I've seen all sorts of articles on altering a trace to capture different data, or stop capturing some data, but nothing to indicate that I can alter the filesize or filecount.

    Can I do this? Or will I need to stop the trace, delete the trace, and re-create the trace with the new values?

    Thankfully, the previous DBA saved the trace creation script, so re-creating won't be too big a hassle, if that's the solution.

    Thanks,

    Jason

  • if this is a server side trace there must be a trace script file somewhere. In there there will be a set @maxfilesize statement, alter that to the value you want (its in MB)

    ---------------------------------------------------------------------

  • Won't that just create a new trace?

    Or will it alter that setting for the existing trace?

    Jason

  • you cannot alter the trace in flight, just stop and restart the trace and it will pickup the new settings.

    ---------------------------------------------------------------------

  • Cool thanks!

    I'll give it a go on Monday.

    Jason

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

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