• Chris Harshman - Monday, February 19, 2018 2:00 PM

    Mike Scalise - Monday, February 19, 2018 12:47 PM

    pietlinden - Sunday, February 18, 2018 2:36 PM

    Then you'd have to correlate that with what's going on on your server. What's running when - using Profiler or something like it.(Can this be done with Extended Events?)

    Then you'd just correlate the growth spikes with stored procedures etc are running just before the spike happens.

    Thanks for the suggestion! I'm actually thinking of doing something like this with sp_WhoIsActive...running it every minute or so and logging activity to help get a look into what's going on at a given period of time...

    Are the transaction log files growing during these times or are they always big and just filling up more over these hours?  If the transaction log files are growing, that information actually gets captured in the default trace (EventClass 92 = Data File, 93 = Log File), which you can see like this:
    DECLARE @path NVARCHAR(260);
    SELECT @path = REVERSE(SUBSTRING(REVERSE([path]), CHARINDEX('\', REVERSE([path])), 260)) + N'log.trc'
    FROM  sys.traces
    WHERE is_default = 1;

    SELECT td.DatabaseName, td.Filename, te.name AS Event, (IntegerData*8)/1024 AS Change_MB, td.StartTime, td.EndTime,
      td.LoginName, td.HostName, td.ApplicationName, td.spid, td.ClientProcessID, td.IsSystem, td.SqlHandle, td.TextData
    FROM sys.fn_trace_gettable(@path, DEFAULT) td
      INNER JOIN sys.trace_events te ON td.EventClass = te.trace_event_id
    WHERE td.EventClass IN (92,93)
    ORDER BY td.StartTime;

    Chris,

    Thank you. This is very interesting. Here are my results for the database in question. I'm not exactly sure how to interpret this. Can you help me understand what it indicates?

    DatabaseName    Filename    Event    Change_MB    StartTime    EndTime
    mydatabase    mydatabase_log01    Log File Auto Grow    2149    2018-02-09 23:22:16.750    2018-02-09 23:22:44.800
    mydatabase    mydatabase_log01    Log File Auto Grow    2364    2018-02-11 05:17:02.333    2018-02-11 05:17:37.237
    mydatabase    mydatabase_log01    Log File Auto Grow    2601    2018-02-11 05:41:17.990    2018-02-11 05:41:54.767
    mydatabase    mydatabase_log01    Log File Auto Grow    2861    2018-02-11 05:54:54.140    2018-02-11 05:55:34.870
    mydatabase    mydatabase_log01    Log File Auto Grow    3147    2018-02-11 06:12:02.763    2018-02-11 06:12:48.667
    mydatabase    mydatabase_log01    Log File Auto Grow    3462    2018-02-11 06:35:04.557    2018-02-11 06:35:54.093
    mydatabase    mydatabase_log01    Log File Auto Grow    3808    2018-02-12 23:24:10.850    2018-02-12 23:25:04.240
    mydatabase    mydatabase_log01    Log File Auto Grow    4189    2018-02-15 23:21:57.480    2018-02-15 23:22:52.953
    mydatabase    mydatabase_log01    Log File Auto Grow    4608    2018-02-18 05:47:27.050    2018-02-18 05:48:29.620
    mydatabase    mydatabase_log01    Log File Auto Grow    5069    2018-02-18 06:13:41.223    2018-02-18 06:14:55.630

    Mike Scalise, PMP
    https://www.michaelscalise.com