Re: Replay Trace Profiler files with T-SQL code

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Jul 17, 12:34 pm, "John Bell" <jbellnewspo...@xxxxxxxxxxx> wrote:
"Pat" <PatrickAlexander.em...@xxxxxxxxx> wrote in message

news:8d35cef6-9b4d-4972-9752-05311e6b81c8@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

HI Freinds,
SQL2008

I have collected trace files and need to replay them on my server only
using T-SQL
how can it be done ?

Thanks,
Pat

Hi Pat

Replaying trace files is a function of the SQL Profiler application, but you
can load the trace file into a database table (if you have saved it to a
file) using fn_trace_gettable(), then cursor through each
statement/procedure called use sp_executeSQL or EXEC to execute each
statement, although if you are using parameters this may be difficult.

Another option would be to export the profile as SQL statement which is
available on the file menu of SQL profiler and run the script it creates.

John

That worked, but how much of relastic load is when you run it as
scripts ?
.



Relevant Pages

  • Re: Replay Trace Profiler files with T-SQL code
    ... Replaying trace files is a function of the SQL Profiler application, ... Even with SQL Profiler replaying the script they may not be executed in the same time scales as the original load. ... Just using T-SQL is never going to give you the means to re-create a true load; even the load testing tools available will not give you an exact replay, but will give you a means of stressing the system, and a method which is more likely to re-create the situation where problems will occur ...
    (microsoft.public.sqlserver.programming)
  • Re: Replay Trace Profiler files with T-SQL code
    ... using T-SQL ... Replaying trace files is a function of the SQL Profiler application, but you can load the trace file into a database table using fn_trace_gettable, then cursor through each statement/procedure called use sp_executeSQL or EXEC to execute each statement, although if you are using parameters this may be difficult. ...
    (microsoft.public.sqlserver.programming)
  • Re: How to distinguish b/w normal trace file and different Sessions enabled SQL trace files?
    ... different Session's SQL enabled trace files which generate in udump ... I want to have a script which distinguishes between different ... Session's SQL enable trace files and normal trace files. ... alter session set tracefile_identifier='....' ...
    (comp.databases.oracle.server)
  • Re: can I send the audit file to a table?
    ... fn_trace_gettable function to load the trace files into a table. ... Refer ... to books online for more information on fn_trace_gettable. ...
    (microsoft.public.sqlserver.security)