Home All Groups Group Topic Archive Search About

What happens to running trace when SQL is shutdown



Author
15 Jun 2009 5:56 PM
David Hay
I have created a trace that runs continuously keeping track of logins,
and failed logins.  It is being written to a file and imported into a
table each hour.  Now normally when the trace is stopped and closed,
that is the trigger to actually dump the data to the trace file which
is then subsequently read into my work tables for processing.

What happens to currently running traces when SQL is shutdown cleanly,
with a proper stop request.

What happens to currently running traces when SQL is NOT shutdown
cleanly, usually someone rebooting the box without bringing SQL down
first.


Thanks!

David Hay

Author
15 Jun 2009 6:28 PM
John Bell
Show quote Hide quote
"David Hay" <david.***@gmail.com> wrote in message
news:f0a0d1b0-3337-494a-b34a-ef4cfe99ab74@r31g2000prh.googlegroups.com...
>
> I have created a trace that runs continuously keeping track of logins,
> and failed logins.  It is being written to a file and imported into a
> table each hour.  Now normally when the trace is stopped and closed,
> that is the trigger to actually dump the data to the trace file which
> is then subsequently read into my work tables for processing.
>
> What happens to currently running traces when SQL is shutdown cleanly,
> with a proper stop request.
>
> What happens to currently running traces when SQL is NOT shutdown
> cleanly, usually someone rebooting the box without bringing SQL down
> first.
>
>
> Thanks!
>
> David Hay
>

Hi David

If the SQL server is stopped the trace the connection will be terminated and
the trace will stop.

John
Are all your drivers up to date? click for free checkup

Author
16 Jun 2009 12:39 PM
David Hay
But will it dump the data in buffer to the trace file as directed, or
does all that data go away?


Show quoteHide quote
On Jun 15, 2:28 pm, "John Bell" <jbellnewspo***@hotmail.com> wrote:
> "David Hay" <david.***@gmail.com> wrote in message
>
> news:f0a0d1b0-3337-494a-b34a-ef4cfe99ab74@r31g2000prh.googlegroups.com...
>
>
>
>
>
> > I have created a trace that runs continuously keeping track of logins,
> > and failed logins.  It is being written to a file and imported into a
> > table each hour.  Now normally when the trace is stopped and closed,
> > that is the trigger to actually dump the data to the trace file which
> > is then subsequently read into my work tables for processing.
>
> > What happens to currently running traces when SQL is shutdown cleanly,
> > with a proper stop request.
>
> > What happens to currently running traces when SQL is NOT shutdown
> > cleanly, usually someone rebooting the box without bringing SQL down
> > first.
>
> > Thanks!
>
> > David Hay
>
> Hi David
>
> If the SQL server is stopped the trace the connection will be terminated and
> the trace will stop.
>
> John
Author
16 Jun 2009 6:31 PM
John Bell
> "David Hay" <david.***@gmail.com> wrote in message
> news:e3624dea-57aa-4494-8c97-428da5632569@s38g2000prg.googlegroups.com...
> But will it dump the data in buffer to the trace file as directed, or
> does all that data go away?

I guess you may have to ask the guy who wrote the code... but my guess is
that it will depend on whether it gets the chance, just like any other
application in those circumstances. If you look at Microsoft SQL Server 2008
Internals Book (which is a must read!) Chapter 2 ISBN: 978-0-7356-2624-9 it
talks about the parts of trace  and the Trace I/O providers, which buffer
output if it can't be consumed so nothing is lost, and how a trace managment
thread is responsible for flushing the file provider buffer, but it doesn't
say whether it guarantees to flush the buffer on failure.

John
Author
17 Jun 2009 6:51 AM
Tibor Karaszi
I agree.My guess is that along with SQL Server exception handling and
shot down code, there is functionality to flush traces and close trace
files. But yank the cord and nothing can finish nicely, of course.

Show quoteHide quote
"John Bell" <jbellnewspo***@hotmail.com> wrote in message
news:u4cyDDr7JHA.1712@TK2MSFTNGP03.phx.gbl...
>
>> "David Hay" <david.***@gmail.com> wrote in message
>> news:e3624dea-57aa-4494-8c97-428da5632569@s38g2000prg.googlegroups.com...
>> But will it dump the data in buffer to the trace file as directed,
>> or
>> does all that data go away?
>
> I guess you may have to ask the guy who wrote the code... but my
> guess is that it will depend on whether it gets the chance, just
> like any other application in those circumstances. If you look at
> Microsoft SQL Server 2008 Internals Book (which is a must read!)
> Chapter 2 ISBN: 978-0-7356-2624-9 it talks about the parts of trace
> and the Trace I/O providers, which buffer output if it can't be
> consumed so nothing is lost, and how a trace managment thread is
> responsible for flushing the file provider buffer, but it doesn't
> say whether it guarantees to flush the buffer on failure.
>
> John

Bookmark and Share