Thursday, March 22, 2012

Accessing current active trace file

Hi,
I am using the following SQL query for retrieving the Trace file
information.
SELECT * FROM ::fn_trace_gettable('C:\Program Files\Microsoft SQL
Server\MSSQL\Data\audittrace_20040822191554.trc', default)
But I am getting following error:
"File 'C:\Program Files\Microsoft SQL
Server\MSSQL\Data\audittrace_20040822191554.trc' either does not exist
or is not a recognizable trace file. Or there was an error opening the
file."
So, can we get the data from the current active trace file?
Thanks and Regards,
Pramod.Hi
The trace needs to be stopped and the file closed before re-opening it.
See:
http://support.microsoft.com/default.aspx?scid=kb;en-us;270599
John
"ipramod@.gmail.com" wrote:
> Hi,
> I am using the following SQL query for retrieving the Trace file
> information.
> SELECT * FROM ::fn_trace_gettable('C:\Program Files\Microsoft SQL
> Server\MSSQL\Data\audittrace_20040822191554.trc', default)
> But I am getting following error:
> "File 'C:\Program Files\Microsoft SQL
> Server\MSSQL\Data\audittrace_20040822191554.trc' either does not exist
> or is not a recognizable trace file. Or there was an error opening the
> file."
> So, can we get the data from the current active trace file?
> Thanks and Regards,
> Pramod.
>|||The trace cannot be read whilst active in SQL2000 however SQL2005 has
improved on this and does allow reading a currently active server side trace
using fn_trace_gettable or the Profiler GUI.
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
<ipramod@.gmail.com> wrote in message
news:1128422380.248267.85480@.f14g2000cwb.googlegroups.com...
> Hi,
> I am using the following SQL query for retrieving the Trace file
> information.
> SELECT * FROM ::fn_trace_gettable('C:\Program Files\Microsoft SQL
> Server\MSSQL\Data\audittrace_20040822191554.trc', default)
> But I am getting following error:
> "File 'C:\Program Files\Microsoft SQL
> Server\MSSQL\Data\audittrace_20040822191554.trc' either does not exist
> or is not a recognizable trace file. Or there was an error opening the
> file."
> So, can we get the data from the current active trace file?
> Thanks and Regards,
> Pramod.
>

No comments:

Post a Comment