sp_trace_getdata SP

  • In a production system i've seen a store procedure running all the time

    exec [master].dbo.sp_trace_getdata 8

    even thouh i kill the proccess 1 minute later it shows uo again

    could anybody tell me what it does and if this SP produces an overhead to the system?

    Is there any way to know who or which client application is triggerring thas SP (Maybe a SQL Profiler) ?

    If this SP produce an overhead how can i deactivate this SP ?

    Thanks in advanced

  • sp_trace_getdata is used by SQL Profiler to read it's trace and return the results to the SQL Profiler GUI/application;

    SQL Profiler is definitely known to have an impact on SQL server...it potentially can have a very severe performance impact if the trace is catching lots of events.

    the way to deactivate it is to not allow anyone to run SQL Profiler;

    you can see who's running it by running sp_who2, and find any thing that has ProgramName like SQL Profiler.

    For that row(s) , look at the username and the hostname, so you know who is using Profiler, and at what machine, and make them stop using profiler.

    if you need to trace something , make a server side trace and use that instead; SQL Profiler can make the trace definition for you.

    a server side trace has a much much lighter impact on the server.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • OK Thanks. Ive got the user and hostname, Im no a DBA and the question is how to make them stop using profiler ?(Maybe denyng EXEC permissios to the user ?

    secondly youre right when you said it is to not allow anyone to run SQL Profiler becase when i open the tracer in the SQL profiler the reply/stop buttons are disable, besides i tested one select commands i found useful in an article posted in this great forum how to stop it from running but didnt work out, maybe you can help me out:

    Execute "select * FROM ::fn_trace_getinfo(default)" - OK

    Identify the traceid you using the folder name specified when starting the trace. OK

    THE BELOW SENTENCES yielded me an error:

    Execute these two commands replacing # with the trace id.

    EXEC sp_trace_setstatus @traceid = #, @status = 0; -- Stop/pause Trace

    EXEC sp_trace_setstatus @traceid = #, @status = 2; -- Close trace and delete it from the server

    Server: Msg 19070, Level 16, State 1, Procedure sp_trace_setstatus, Line 1

    The default trace cannot be stopped or modified. Use SP_CONFIGURE to turn it off.

    the above error doent have to do with permissions or something likke that ?

    How can i solve it ?

    Thnaks a lot in advanced

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

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