Thursday, March 8, 2012

Audit Trace Files

I am using server side traces to enable SQL Server 2000 and 2005 auditing.
Every time I start the server, I define a new trace file for auditing. So
till now I have configured around 100 trace files.
Now I want to get the list of all the trace files (which are at different
location in my PC), using some mechanism. Please let me know if there is a
function or procedure which will give me all the trace files that have been
configured for auditing in SQL 2000 and 2005.
I found a function fn_trace_getinfo, which returns information about a
specified trace or all existing traces, but I want all the trace files, whic
h
have been created till now, irrespective of whether they are active or not.
Is there a function in SQL which would help me in this?Munish Narula (munish.narula@.wipro.com) writes:
> I am using server side traces to enable SQL Server 2000 and 2005 auditing.
> Every time I start the server, I define a new trace file for auditing. So
> till now I have configured around 100 trace files.
> Now I want to get the list of all the trace files (which are at
> different location in my PC), using some mechanism. Please let me know
> if there is a function or procedure which will give me all the trace
> files that have been configured for auditing in SQL 2000 and 2005.
> I found a function fn_trace_getinfo, which returns information about a
> specified trace or all existing traces, but I want all the trace files,
> which have been created till now, irrespective of whether they are
> active or not.
> Is there a function in SQL which would help me in this?
I don't think so. As I understand it, once a trace is done, SQL Server
forgets all about it.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Hi
In SQL Server 2005 take a look at sys.traces system table
"Munish Narula" <munish.narula@.wipro.com> wrote in message
news:4412799B-EE0B-431B-92E2-F51988471166@.microsoft.com...
>I am using server side traces to enable SQL Server 2000 and 2005 auditing.
> Every time I start the server, I define a new trace file for auditing. So
> till now I have configured around 100 trace files.
> Now I want to get the list of all the trace files (which are at different
> location in my PC), using some mechanism. Please let me know if there is a
> function or procedure which will give me all the trace files that have
> been
> configured for auditing in SQL 2000 and 2005.
> I found a function fn_trace_getinfo, which returns information about a
> specified trace or all existing traces, but I want all the trace files,
> which
> have been created till now, irrespective of whether they are active or
> not.
> Is there a function in SQL which would help me in this?|||Hi,
Thanks for the response.
But this again does not solve my problem. The sys.traces catalog view
contains the current running traces on the system. This view is intended as
a
replacement for the fn_trace_getinfo function.
I want to get all the trace files that have been created so far.
"Uri Dimant" wrote:

> Hi
> In SQL Server 2005 take a look at sys.traces system table
>
>
> "Munish Narula" <munish.narula@.wipro.com> wrote in message
> news:4412799B-EE0B-431B-92E2-F51988471166@.microsoft.com...
>
>|||Munish
I'm affraid you cannot. Once trace is stopped SQL Server does not keep any
info about it
"Munish Narula" <munish.narula@.wipro.com> wrote in message
news:07439C49-276C-4677-B975-0341882D2C0F@.microsoft.com...[vbcol=seagreen]
> Hi,
> Thanks for the response.
> But this again does not solve my problem. The sys.traces catalog view
> contains the current running traces on the system. This view is intended
> as a
> replacement for the fn_trace_getinfo function.
> I want to get all the trace files that have been created so far.
>
>
> "Uri Dimant" wrote:
>|||You can get the file path only for active and stopped traces. As Erland and
Uri mentioned, no record is kept after the trace is deleted.
It's not hard to develop a process to manage trace files, though. For
example, I have a daily SSIS package that restarts a trace and copies the
files to an archive folder.
Hope this helps.
Dan Guzman
SQL Server MVP
"Munish Narula" <munish.narula@.wipro.com> wrote in message
news:4412799B-EE0B-431B-92E2-F51988471166@.microsoft.com...
>I am using server side traces to enable SQL Server 2000 and 2005 auditing.
> Every time I start the server, I define a new trace file for auditing. So
> till now I have configured around 100 trace files.
> Now I want to get the list of all the trace files (which are at different
> location in my PC), using some mechanism. Please let me know if there is a
> function or procedure which will give me all the trace files that have
> been
> configured for auditing in SQL 2000 and 2005.
> I found a function fn_trace_getinfo, which returns information about a
> specified trace or all existing traces, but I want all the trace files,
> which
> have been created till now, irrespective of whether they are active or
> not.
> Is there a function in SQL which would help me in this?

No comments:

Post a Comment