Re: trace Id for C2 audit



The trace_id that is enabled by default in SQL 2005 is not the same as a
blackbox trace. It is just a default system trace used to populate some of
the summary reports. This trace should not be considered a blackbox,
because it doesn't capture any information about batches that have been
executed, so it is not very useful for tracking down the cause of bad
behavior. A blackbox trace can be explicitly started with sp_trace_create
procedure, providing the property parameter value of 8.

I agree with Dan that you shouldn't rely on a trace having a particular ID
unless it is so documented (and of course, the documentation can sometimes
be wrong. ;-) )

You can query the sys.traces view easily enough to find out what the
trace_id of the c2 trace is. It's a bit harder to query fn_trace_getinfo but
certainly possible.

--
HTH
Kalen Delaney, SQL Server MVP
www.InsideSQLServer.com
http://sqlblog.com


"Erland Sommarskog" <esquel@xxxxxxxxxxxxx> wrote in message
news:Xns9A126ADA1EFYazorman@xxxxxxxxxxxx
Munish Narula (munish.narula@xxxxxxxxx) writes:
Is it a fair assumption to make, that the traceId of c2 auditing is
always 1?

Say, I have switched on C2 audit in SQL 2000 and 2005 and i use
fn_trace_getinfo to get the active trace. Will it always return me
traceId as 1?

SQL 2005 has a "blackbox trace" enabled by default with trace id = 1. But
I don't know whether that trace is disabled if you turn on C2.



--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


.



Relevant Pages

  • Re: Tracking user activities
    ... >> I'd like these settings to persist permanently and the event records to ... > In SQL 2000, this is not very simple to do. ... > Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... select Script Trace. ...
    (comp.databases.ms-sqlserver)
  • Re: C2 SQL auditing
    ... Andrew J. Kelly SQL MVP ... Do you suggest any third party tools for SOX compliance? ... I would like to off load the server side trace to the SOX team ... when I stop SQL server then my trace file gets populated. ...
    (microsoft.public.sqlserver.security)
  • Re: SQL logins logged where
    ... you can't trace directly to a table but can use the> fn_trace_gettable function to load the trace file into a> table. ... If you are using SQL Server 7, use> xp_trace_setqueuedestination to set the destination to a> table. ... Security Tab does not give too many ...
    (microsoft.public.sqlserver.security)
  • Re: Simple timeout problem
    ... Brian, I haven't found anything specific on this error. ... We'd want to limit the trace to just the BizTalkRuleEngineDB. ... To run a trace go to SQL Profiler (under the SQL Server entry in the start ... | are reporting a timeout condition trying to connect to the SQL database. ...
    (microsoft.public.biztalk.general)
  • Re: Profiler Bug viewing trace flat file?
    ... Kalen Delaney, SQL Server MVP ... Run this code to create a trace capture of the RPC:Complete event: ... declare @error INT ... Now open the trace file in Profiler and you will see that the Textdata ...
    (microsoft.public.sqlserver.tools)