For (recent) historical information, you can consult the default trace (background in this answer):
DECLARE @path nvarchar(260);
SELECT
@path = REVERSE(SUBSTRING(REVERSE([path]),
CHARINDEX(CHAR(92), REVERSE([path])), 260)) + N'log.trc'
FROM sys.traces
WHERE is_default = 1;
SELECT TextData, [Database] = DB_NAME(DatabaseID), LoginName
FROM sys.fn_trace_gettable(@path, DEFAULT)
WHERE EventClass = 116
AND UPPER(CONVERT(nvarchar(max), TextData)) LIKE N'%SHRINK%';
-- could be SHRINKDATABASE
However, this just tells you when they happened and who did it. It does not include how much shrinking happened (if any) or even if the file grew (which, yes, is possible via SHRINKFILE
). It doesn't even allow you to calculate duration, which might help you infer how much shrinking happened, because the DBCC events are captured when they start.
To capture this information on an ongoing basis, I would say don't just run DBCC SHRINKFILE()
, but wrap that in a script that polls for the file sizes before and after. You could use an Extended Events session as described in another answer, but that session doesn't look like it captures size.