tag:blogger.com,1999:blog-6101006543641561368.post3967945293650788936..comments2024-01-19T11:43:10.765-06:00Comments on sqlfingers.com: Who shrunk that database file?sqlfingershttp://www.blogger.com/profile/17197470820730005093noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-6101006543641561368.post-54975856309912950002019-01-28T14:15:53.391-06:002019-01-28T14:15:53.391-06:00Yeah, I loved that Hamster reference as well, but ...Yeah, I loved that Hamster reference as well, but cannot take credit... https://www.brentozar.com/blitz/auto-shrink-enabled/rebecca@sqlfingershttps://www.blogger.com/profile/08888053333630840930noreply@blogger.comtag:blogger.com,1999:blog-6101006543641561368.post-21840984617862325692019-01-28T13:28:47.217-06:002019-01-28T13:28:47.217-06:00"Hamster Wheel of Death"!!! You are kil..."Hamster Wheel of Death"!!! You are killing me. But seriously, folks, thanks for the explanations in this article.Curtnoreply@blogger.comtag:blogger.com,1999:blog-6101006543641561368.post-81548793054032913112019-01-28T13:27:30.832-06:002019-01-28T13:27:30.832-06:00Adding just a bit of automation for the very handy...Adding just a bit of automation for the very handy query from SQL Fingers site.<br /><br />-- Determine location for the Default Trace file. Applies to SQL 2005-2019.<br />-- Declare temp variable to store trace file location.<br />DECLARE @TraceInfo TABLE<br /> (TraceID INT,<br /> Property INT,<br /> Value VARCHAR(MAX) ) ;<br />INSERT INTO @TraceInfo select TraceId, Property, CONVERT(VARCHAR(max), Value) AS [Value] FROM :: fn_trace_getinfo (default) ;<br />DECLARE @AuditLoginTracePath NVARCHAR(256) = (SELECT [VALUE] FROM @TraceInfo WHERE [Value] LIKE '%MSSQL%log[_]%.trc') ;<br /><br />-- Query Default Trace for any shrinkfile events.<br />SELECT<br /> TextData,<br /> HostName,<br /> ApplicationName,<br /> LoginName, <br /> StartTime <br />FROM <br /> [fn_trace_gettable](@AuditLoginTracePath, DEFAULT) <br />WHERE <br /> TextData LIKE 'DBCC SHRINKFILE%' ;<br />Just_A_DBAhttps://www.blogger.com/profile/16546065726529374601noreply@blogger.com