Re: Log Reader

From: Andrew J. Kelly (sqlmvpnooospam_at_shadhawk.com)
Date: 09/10/04


Date: Thu, 9 Sep 2004 21:18:49 -0400

You can use fn_trace_gettable to read the file like a table. So you can
query it directly or insert the results into a table. See BooksOnLine for
more details.

-- 
Andrew J. Kelly  SQL MVP
"Percio" <Percio@discussions.microsoft.com> wrote in message
news:EF5B4DE7-08CB-4880-9D79-CF619A4BE7FD@microsoft.com...
> Thanks so much for the help but there is one more thing that I see i can
do
> by using profile but not using the sp's. Is there a way i can keep the
trace
> information into a table using the sps you mentioned to me ??
>
> Thanks
>
> "Andrew J. Kelly" wrote:
>
> > The path you specify is from the servers viewpoint and not yours.  Even
> > though you may be runing the script from QA on your machine the trace
file
> > will get put on the server under the specified path.
> >
> >
> > -- 
> > Andrew J. Kelly  SQL MVP
> >
> >
> > "Percio" <Percio@discussions.microsoft.com> wrote in message
> > news:03B58279-57DD-44A7-B665-95B3AB824D44@microsoft.com...
> > > Thanks so much and sorry for the stupid questions but now for some
reason
> > > that i dont know yet i could create the tracing, but now i am having a
new
> > > issue. After run one of your examples i get a successfull message but
the
> > > .trc file is not being created phisically in my machine, then i run
the
> > > comand to stop and clear the trace and re run the commands and it say
the
> > > file already exists, then i set the option to overwrite and it goes ok
but
> > i
> > > never get the .trc file on the path i specified and when also i run
the
> > > command
> > > declare @FileExists int
> > > EXEC master..xp_fileexist 'D:\Test1.trc', @FileExists OUT
> > > print @FileExists
> > >
> > > it say the file still there, very weird to me because i dont see the
file
> > > there. how do i open this file to see the tracing i am getting ?
> > >
> > > Thanks for now
> > >
> > > Percio
> > >
> > > "Narayana Vyas Kondreddi" wrote:
> > >
> > > > Make sure you are specifying a valid path on the SQL Server
computer. If
> > you
> > > > want to save the output to a different machine, then provide a UNC
name.
> > > > Also make sure SQL Server service account has permissions to the
path
> > you
> > > > are writing to.
> > > > -- 
> > > > HTH,
> > > > Vyas, MVP (SQL Server)
> > > > http://vyaskn.tripod.com/
> > > >
> > > >
> > > > "Percio" <Percio@discussions.microsoft.com> wrote in message
> > > > news:F8AADA4C-7C9B-401F-B7EF-F70AB4FE9F15@microsoft.com...
> > > > Thanks a lot for the help but when I run your store procedures and
try
> > to
> > > > execute i keep getting this message info
> > > >
> > > > (1 row(s) affected)
> > > >
> > > > Server: Msg 50000, Level 16, State 1, Procedure CreateTrace, Line
125
> > > > Failed to create trace. Error: File not created. Source: CreateTrace
> > > >
> > > > Thanks
> > > >
> > > > "Narayana Vyas Kondreddi" wrote:
> > > >
> > > > > There isn't a user friendly way to read SQL Server transaction
logs.
> > There
> > > > > are some commands/functions provided, but are undocumented or not
much
> > > > > information published on them. For example:
> > > > >
> > > > > DBCC LOG
> > > > > fn_dblog
> > > > >
> > > > > There are third party tools that can do this, like Lumigent Log
> > Explorer,
> > > > > LogPi etc.
> > > > >
> > > > > However, for your requirement, you could use Profiler or Server
side
> > > > tracing
> > > > > stored procedures to track the activity of specific users. For
> > example:
> > > > >
> > > > > Automating Server Side Tracing in SQL Server
> > > > > http://vyaskn.tripod.com/server_side_tracing_in_sql_server.htm
> > > > >
> > > > > Identifying performance issues using SQL Server Profiler
> > > > > http://vyaskn.tripod.com/analyzing_profiler_output.htm
> > > > > -- 
> > > > > HTH,
> > > > > Vyas, MVP (SQL Server)
> > > > > http://vyaskn.tripod.com/
> > > > >
> > > > >
> > > > > "Percio" <Percio@discussions.microsoft.com> wrote in message
> > > > > news:C3EF98BE-8052-448A-8E40-62115C2686AF@microsoft.com...
> > > > > I am trying to know how can I read the logs made by a sql server
> > during a
> > > > > period of time. For example I would like to know if a user
connects to
> > the
> > > > > sql server and start to do alter, create sql objects. My purpose
is to
> > > > track
> > > > > my developer users in my sql server. Is there any native store
> > procedure
> > > > to
> > > > > read that ??
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> >
> >
> >


Relevant Pages

  • Re: automating profiler
    ... Andrew J. Kelly SQL MVP ... >> want to trace directly to a table if you care about performance. ... >> Andrew J. Kelly SQL MVP ... >> produce reports with Reporting Services. ...
    (microsoft.public.sqlserver.tools)
  • Re: How to display the command text when a long transaction is on proc
    ... The only way to see what line is actually executing is to start a trace ... beforehand with stmt:starting event. ... Andrew J. Kelly SQL MVP ...
    (microsoft.public.sqlserver.connect)
  • Re: Log Reader
    ... Is there a way i can keep the trace ... > Andrew J. Kelly SQL MVP ... >> that i dont know yet i could create the tracing, but now i am having a new ... >> comand to stop and clear the trace and re run the commands and it say the ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL profiler question
    ... Trace to a file and then use fn_trace_gettable to ... > Andrew J. Kelly SQL MVP ... >> I started a trace that loads a table. ...
    (microsoft.public.sqlserver.tools)
  • Re: SQL profiler question
    ... I created the trace to load a file. ... "Andrew J. Kelly" wrote: ... > Andrew J. Kelly SQL MVP ...
    (microsoft.public.sqlserver.tools)