October 6, 2014 at 6:43 am
I captured the trace on Machine A of SQL instance1. and keep the trace in D drive. I want to send that trace file to sql server table in instance2 in another machine B.
How to send that?
October 6, 2014 at 6:48 am
Copy the file to machine B, then use the SQL function fn_trace_gettable
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
October 6, 2014 at 6:51 am
If the second server doesn't have access to the D drive of the first server you first need to copy the physical file to an accessible location. Next you can execute the following T-SQL on the second server:
SELECT
IDENTITY(int, 1, 1) AS RowNumber
, *
INTO [trace_table_name]
FROM ::fn_trace_gettable('D:\your_tracefile_name.trc', default)
October 6, 2014 at 6:56 am
HanShi (10/6/2014)
If the second server doesn't have access to the D drive of the first server you first need to copy the physical file to an accessible location. Next you can execute the following T-SQL on the second server:
SELECT
IDENTITY(int, 1, 1) AS RowNumber
, *
INTO [trace_table_name]
FROM ::fn_trace_gettable('D:\your_tracefile_name.trc', default)
The :: hasn't been required since SQL 2000.
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
October 6, 2014 at 7:00 am
GilaMonster (10/6/2014)
HanShi (10/6/2014)
If the second server doesn't have access to the D drive of the first server you first need to copy the physical file to an accessible location. Next you can execute the following T-SQL on the second server:
SELECT
IDENTITY(int, 1, 1) AS RowNumber
, *
INTO [trace_table_name]
FROM ::fn_trace_gettable('D:\your_tracefile_name.trc', default)
The :: hasn't been required since SQL 2000.
Thanks for pointing that out. Thats the problem with scripts you use for a very long time. You don't take the time to update them as much as you need to.
October 6, 2014 at 10:29 am
If we have same trace in different files like Perftrace1, Perftrace2, Perftrace3.
How can I roll over all those in to single sql table?
October 6, 2014 at 1:21 pm
Default it will read all sequential files, but you can add the desired number of files as an extra parameter,. See sys.fn_trace_gettable (Transact-SQL) for a complete explanation of this function.
October 6, 2014 at 1:38 pm
Or, if they're different traces, rather than rollover files, by using INSERT INTO instead of SELECT ... INTO
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
October 6, 2014 at 6:14 pm
Little confuse about the profiler timings.
Correct me if I am wrong
When we selecting trace from Tools the time filter is in milliseconds but when we are monitoring from the trace also it will display millisec but when we sent to that into the sql server table, it will display in microsec.
October 6, 2014 at 11:58 pm
ramana3327 (10/6/2014)
Little confuse about the profiler timings.Correct me if I am wrong
When we selecting trace from Tools the time filter is in milliseconds but when we are monitoring from the trace also it will display millisec but when we sent to that into the sql server table, it will display in microsec.
Correct!
The trace stores (file or table) the values in microseconds and displays (GUI) in miliseconds.
October 7, 2014 at 6:22 am
Thank you.
I am able to run the profiler from the tools under ssms and saving the ssrs trace in D-Drive. When I scriptout the trace template to run like server side trace and gave the same location to save the trace file, it is not working
October 7, 2014 at 6:32 am
What do you mean 'it's not working'?
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
October 7, 2014 at 7:36 am
It is giving that the path doesn't exist msg.
October 7, 2014 at 8:05 am
ramana3327 (10/7/2014)
It is giving that the path doesn't exist msg.
Have you (double) checked the given path exists locally on the SQL Server? And does the SQL Server service account has modify permissions on that folder?
October 7, 2014 at 8:11 am
ramana3327 (10/7/2014)
It is giving that the path doesn't exist msg.
You've double-checked that there are no spelling mistakes in the script, the server you're running the trace against has a local D drive and the path you've specified does exist?
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
Viewing 15 posts - 1 through 15 (of 21 total)
You must be logged in to reply to this topic. Login to reply