May 29, 2009 at 6:45 am
So I'm running some tests with Profiler. I create a database with a minimal filesize, create a Trace where I select under databases all the Autogrow/Autoshrink options. I start the trace and next Insert a 100 records in my testtable. I can see for myself that de datafile has increased, but my Trace does not mention this.
When selecting these events comment tells me, that these events will not start on ALTER DATABASE. I hope that the Autogrow option does not work with this statement...
What am I missing?
Greetz,
Hans Brouwer
May 29, 2009 at 7:06 am
I think I got the following code from this forum and it would retrieve the AUTO GROW info from the default trace.
Please try this..
SELECT
trc_evnt.name
,dflt_trc.DatabaseName
,dflt_trc.ApplicationName
,dflt_trc.TextData
,dflt_trc.FileName
,dflt_trc.LoginName
,dflt_trc.StartTime
FROM sys.traces T (NOLOCK) CROSS Apply ::fn_trace_gettable(CASE
WHEN CHARINDEX( '_',T.[path]) 0 THEN
SUBSTRING(T.PATH, 1, CHARINDEX( '_',T.[path])-1) + '.trc'
ELSE T.[path]
End, T.max_files) AS dflt_trc
INNER JOIN sys.trace_events AS trc_evnt
ON dflt_trc.EventClass = trc_evnt.trace_event_id
WHERE
trc_evnt.name like '%Auto Grow%'
ORDER BY dflt_trc.StartTime DESC
May 29, 2009 at 7:21 am
Tnx Sunny, works like a charm, and it's a better solution then what I had in mind.
Still I would like to know what I should select in Profiler to get this info.
Any1?
Greetz,
Hans Brouwer
May 29, 2009 at 7:27 am
You would select Database:Database File Auto Grow and Database:Log File Auto Grow. Since these are collected by the Default Trace there really is no reason to do another trace for them, in my opinion.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply