SQL 2005 - Server Trace

  • trying Server side trace with standard template (with additional columns included), but the trace stops after 5MB. How to increase this default size to say 20MB and also enable rollover to next file in case, the max limit is reached?

  • In the script that creates the trace, you can set the file size. If I recall, it's defined in a variable right at the beginning of the script.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • yes saw where to give that file size and rollover. thanks. But when observing the trace using the ::fn.... I see that a single SPID gets repeated more than 200 times with a millisecond difference in time. We are using an VB based front end in which there may be around 200 users using that. In Activity Monitor, I see only one task/SPID against that username whereas the trace contains more than 200 records with same SPDI? I dont understand it. Can u demystify this?

  • Does your VB process use a single login to the database or pass the user's login credentials through to the database? You may need to capture this information inside the VB as part of the transactional processes, or require adding auditing to the VB application.

    If the process is web-based, is there a web.config file that authenticates to the database? If so, then VB owns the problem, not the database.

  • Try this:::

    declare @maxfilesize bigint

    exec @rc = sp_trace_create @TraceID output, 0, N'c:\InsertFileNameHere', @maxfilesize, NULL

    -- 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

    --Ron

  • Oooppss.

    Forgot one piece... AM I RED

    set @maxfilesize = 20

    --Ron

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

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