Default Trace log files to find the cause of the rapid growth

select
  loginname,
  loginsid,
  spid,
  hostname,
  applicationname,
  servername,
  databasename,
  objectname,
  e.category_id,
  cat.name,
  textdata,
  starttime,
  endtime,
  duration,
  eventclass,
  eventsubclass,
  e.name as EventName
from ::fn_trace_gettable('C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\log.trc',0)
  inner join sys.trace_events e
          on eventclass =trace_event_id
   Inner  the Join sys.trace_categories AS CAT
           ON e.category_id = cat.category_id
 the WHERE DatabaseName =  ' TraceDB '  and 
      e.category_id =  2  and  - categroy 2 represents Database 
      e.trace_event_id =  93  - 93 indicates that the log file to grow automatically events

 

Guess you like

Origin www.cnblogs.com/VicLiu/p/11780673.html