Re: Setting up Trace in SQL

From: Audrey L (robwhitz_at_yahoo.com)
Date: 11/22/03


Date: Sat, 22 Nov 2003 08:23:21 -0800

Hi Andrew,

The company has a policy and states that we have to audit
our databases. That's why I have created a stored
procedure to handle this.

This is the command that executes the audit at every
startup.
**exec sp_procoption N'usp_SQLAudit', N'startup', N'true'**

Within the same SP, it will output the audit info to a
file. It will rollover each time it reaches 5MB, and the
new filename will be AuditFile_1, AuditFile_2 and so forth.
**exec sp_trace_create @TraceID output, 2,
N'D:\mssql\audit\AuditFile'**

With the above command, how can I specify a unique
filename? It would be pretty cool if I can prefix with
yyyymmdd_AuditFile.

Thanks,
Audrey

>-----Original Message-----
>Although I don't usually set up traces to start when the
db restarts I don't
>know why the presence of an existing file would be an
issue. How exactly
>are you starting the trace? Can you simply specify a
name for the file
>that would be unique each time it runs?
>
>--
>
>Andrew J. Kelly
>SQL Server MVP
>
>
><anonymous@discussions.microsoft.com> wrote in message
>news:057a01c3b0ba$16ffbbd0$a401280a@phx.gbl...
>> I agree. But supposed if I were to re-start the DB, the
>> audit does not kick off at all coz the trace files still
>> exist in the system.
>>
>> In that case, I would need to move the trace files out
>> from the designated directory. Where and how can I do
>> this? Ot typically, how does the other DBA achieve
this?
>>
>> >-----Original Message-----
>> >There is no way to append it that I know of. What
>> benefit would this give
>> >you?
>> >
>> >--
>> >
>> >Andrew J. Kelly
>> >SQL Server MVP
>> >
>> >
>> >"Audrey L" <robwhitz@yahoo.com> wrote in message
>> >news:07c601c3afe8$20a4ca90$a101280a@phx.gbl...
>> >> Hi,
>> >>
>> >> I have configured SQL Server to activate a trace at
>> every
>> >> server startup. The main objective is to audit all
>> >> critical events on the DB.
>> >>
>> >> As the maxsize of the trace file is 5MB, I managed to
>> >> configure it to perform a rollover whenever the
>> threshold
>> >> is reached.
>> >>
>> >> One thing that I would like to clarify is: - Suppose
the
>> >> trace file 'TraceA.trc' already exists in the
directory.
>> >> The DB was re-started. New records are not appended
to
>> >> the trace file at all. Is there a way to activate
this?
>> >> Or is there any workaround?
>> >>
>> >> Would appreciate advice. Thanks ...
>> >
>> >
>> >.
>> >
>
>
>.
>



Relevant Pages

  • Re: Autoexec.nt file missing?
    ... you can't enable Auditing on a computer running Home Edition. ... You must specify what to audit. ... > example, a file, folder, registry key, printer, and so forth-that has its ...
    (microsoft.public.windowsxp.newusers)
  • Re: XPP on Domain - can I make Directories private - even from Admin?
    ... Try to remove an entry. ... Turn on Auditing for the folders. ... You must specify what to audit. ...
    (microsoft.public.windowsxp.general)
  • Re: XPP on Domain - can I make Directories private - even from Admin?
    ... Turn on Auditing for the folders. ... You must specify what to audit. ... >> box and clear the Success and Failure check boxes. ...
    (microsoft.public.windowsxp.general)
  • Re: SUMPRODUCT help
    ... "Bob Phillips" wrote: ... Note that SUMPRODUCT doesn't work with complete columns, you have to specify ... Now I need to use the above count if combined with =COUNTIF(' Audit ...
    (microsoft.public.excel.worksheet.functions)
  • Re: SUMPRODUCT help
    ... Note that SUMPRODUCT doesn't work with complete columns, you have to specify ... (there's no email, no snail mail, but somewhere should be gmail in my addy) ... Now I need to use the above count if combined with =COUNTIF(' Audit ...
    (microsoft.public.excel.worksheet.functions)