Confirmed on my local 2022 instance using:
SET NOCOUNT ON;
DECLARE
@CurrentSize integer,
@i integer = 1,
@SQL nvarchar(max);
SELECT @CurrentSize = DF.size * 8 / 1024
FROM sys.database_files AS DF
WHERE DF.[name] = N'Sandpit_log';
WHILE @i <= 10
BEGIN
SET @SQL = CONCAT
(
N'
ALTER DATABASE Sandpit
MODIFY FILE
(
NAME = N''Sandpit_log'',
SIZE = ',
@CurrentSize + (@i * 64),
N',
FILEGROWTH = 64MB
);'
)
EXECUTE (@SQL);
SET @i += 1;
END;
Output from global trace flags 3004 (show instant file initialisation details) and 1810 (growth event details) with 3604 also enabled to direct output to the SSMS messages tab:
Skip zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 8192 to 16384 (Offset 0x4000000 to 0x8000000) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 131072 KB).
Skip zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 16384 to 24576 (Offset 0x8000000 to 0xc000000) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 196608 KB).
Skip zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 24576 to 32768 (Offset 0xc000000 to 0x10000000) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 262144 KB).
Skip zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 32768 to 40960 (Offset 0x10000000 to 0x14000000) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 327680 KB).
Skip zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 40960 to 49152 (Offset 0x14000000 to 0x18000000) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 393216 KB).
Skip zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 49152 to 57344 (Offset 0x18000000 to 0x1c000000) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 458752 KB).
Skip zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 57344 to 65536 (Offset 0x1c000000 to 0x20000000) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 524288 KB).
Skip zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 65536 to 73728 (Offset 0x20000000 to 0x24000000) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 589824 KB).
Skip zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 73728 to 81920 (Offset 0x24000000 to 0x28000000) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 655360 KB).
Skip zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 81920 to 90112 (Offset 0x28000000 to 0x2c000000) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 720896 KB).
Trace flag 1810 has a bug in its format string (%l64d
instead of %I64d
). If you don't fix that yourself, you can monitor growth using the Extended Events database_file_size_change
or modify_file_operation
instead. There's no event to monitor IFI as far as I know, so you'll need 3004 for that part.
sys.dm_db_log_info
before the log growths:
database_id |
file_id |
vlf_begin_offset |
vlf_size_mb |
vlf_sequence_number |
vlf_active |
vlf_status |
vlf_parity |
vlf_first_lsn |
vlf_create_lsn |
vlf_encryptor_thumbprint |
5 |
2 |
8192 |
1.93 |
87 |
0 |
0 |
128 |
00000000:00000000:0000 |
00000000:00000000:0000 |
NULL |
5 |
2 |
2039808 |
1.93 |
88 |
0 |
0 |
128 |
00000000:00000000:0000 |
00000000:00000000:0000 |
NULL |
5 |
2 |
4071424 |
1.93 |
89 |
1 |
2 |
128 |
00000059:00000010:0001 |
00000000:00000000:0000 |
NULL |
5 |
2 |
6103040 |
2.17 |
42 |
0 |
0 |
64 |
00000000:00000000:0000 |
00000000:00000000:0000 |
NULL |
5 |
2 |
8388608 |
56 |
43 |
0 |
0 |
64 |
00000000:00000000:0000 |
00000027:0000010B:0001 |
NULL |
and afterward:
database_id |
file_id |
vlf_begin_offset |
vlf_size_mb |
vlf_sequence_number |
vlf_active |
vlf_status |
vlf_parity |
vlf_first_lsn |
vlf_create_lsn |
vlf_encryptor_thumbprint |
5 |
2 |
8192 |
1.93 |
87 |
0 |
0 |
128 |
00000000:00000000:0000 |
00000000:00000000:0000 |
NULL |
5 |
2 |
2039808 |
1.93 |
88 |
0 |
0 |
128 |
00000000:00000000:0000 |
00000000:00000000:0000 |
NULL |
5 |
2 |
4071424 |
1.93 |
89 |
1 |
2 |
128 |
00000059:00000010:0001 |
00000000:00000000:0000 |
NULL |
5 |
2 |
6103040 |
2.17 |
42 |
0 |
0 |
64 |
00000000:00000000:0000 |
00000000:00000000:0000 |
NULL |
5 |
2 |
8388608 |
56 |
43 |
0 |
0 |
64 |
00000000:00000000:0000 |
00000027:0000010B:0001 |
NULL |
5 |
2 |
67108864 |
64 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000088F:0002 |
NULL |
5 |
2 |
134217728 |
64 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:00000896:0001 |
NULL |
5 |
2 |
201326592 |
64 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000089D:0001 |
NULL |
5 |
2 |
268435456 |
64 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008A4:0001 |
NULL |
5 |
2 |
335544320 |
64 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008AB:0001 |
NULL |
5 |
2 |
402653184 |
64 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008B2:0001 |
NULL |
5 |
2 |
469762048 |
64 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008B9:0001 |
NULL |
5 |
2 |
536870912 |
64 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008C0:0001 |
NULL |
5 |
2 |
603979776 |
64 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008C7:0001 |
NULL |
5 |
2 |
671088640 |
64 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008CE:0001 |
NULL |
Noticed each growth added a single virtual log file (VLF).
The new feature can be disabled with global trace flag 1837. With that set, the output changes to:
Zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 8192 to 16384 (Offset 0x4000000 to 0x8000000) 64 mb
Zeroing completed on D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (elapsed = 25 ms) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 131072 KB).
Zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 16384 to 24576 (Offset 0x8000000 to 0xc000000) 64 mb
Zeroing completed on D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (elapsed = 23 ms) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 196608 KB).
Zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 24576 to 32768 (Offset 0xc000000 to 0x10000000) 64 mb
Zeroing completed on D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (elapsed = 28 ms) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 262144 KB).
Zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 32768 to 40960 (Offset 0x10000000 to 0x14000000) 64 mb
Zeroing completed on D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (elapsed = 22 ms) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 327680 KB).
Zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 40960 to 49152 (Offset 0x14000000 to 0x18000000) 64 mb
Zeroing completed on D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (elapsed = 23 ms) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 393216 KB).
Zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 49152 to 57344 (Offset 0x18000000 to 0x1c000000) 64 mb
Zeroing completed on D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (elapsed = 28 ms) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 458752 KB).
Zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 57344 to 65536 (Offset 0x1c000000 to 0x20000000) 64 mb
Zeroing completed on D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (elapsed = 22 ms) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 524288 KB).
Zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 65536 to 73728 (Offset 0x20000000 to 0x24000000) 64 mb
Zeroing completed on D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (elapsed = 22 ms) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 589824 KB).
Zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 73728 to 81920 (Offset 0x24000000 to 0x28000000) 64 mb
Zeroing completed on D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (elapsed = 29 ms) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 655360 KB).
Zeroing D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf from page 81920 to 90112 (Offset 0x28000000 to 0x2c000000) 64 mb
Zeroing completed on D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (elapsed = 23 ms) 64 mb
Grow the file D:\Databases\MSSQL16.SQL2022\MSSQL\DATA\Sandpit_log.ldf (file_id = 2, auto_grow = 0, growth = 65536 KB, new_size = 720896 KB).
Resetting to the same starting point and running the ten growth script again, the log DMV shows:
database_id |
file_id |
vlf_begin_offset |
vlf_size_mb |
vlf_sequence_number |
vlf_active |
vlf_status |
vlf_parity |
vlf_first_lsn |
vlf_create_lsn |
vlf_encryptor_thumbprint |
5 |
2 |
8192 |
1.93 |
87 |
0 |
0 |
128 |
00000000:00000000:0000 |
00000000:00000000:0000 |
NULL |
5 |
2 |
2039808 |
1.93 |
88 |
0 |
0 |
128 |
00000000:00000000:0000 |
00000000:00000000:0000 |
NULL |
5 |
2 |
4071424 |
1.93 |
89 |
1 |
2 |
128 |
00000059:00000010:0001 |
00000000:00000000:0000 |
NULL |
5 |
2 |
6103040 |
2.17 |
42 |
0 |
0 |
64 |
00000000:00000000:0000 |
00000000:00000000:0000 |
NULL |
5 |
2 |
8388608 |
56 |
43 |
0 |
0 |
64 |
00000000:00000000:0000 |
00000027:0000010B:0001 |
NULL |
5 |
2 |
67108864 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008F6:0001 |
NULL |
5 |
2 |
83886080 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008F6:0001 |
NULL |
5 |
2 |
100663296 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008F6:0001 |
NULL |
5 |
2 |
117440512 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008F6:0001 |
NULL |
5 |
2 |
134217728 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008FE:0001 |
NULL |
5 |
2 |
150994944 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008FE:0001 |
NULL |
5 |
2 |
167772160 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008FE:0001 |
NULL |
5 |
2 |
184549376 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:000008FE:0001 |
NULL |
5 |
2 |
201326592 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:00000906:0001 |
NULL |
5 |
2 |
218103808 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:00000906:0001 |
NULL |
5 |
2 |
234881024 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:00000906:0001 |
NULL |
5 |
2 |
251658240 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:00000906:0001 |
NULL |
5 |
2 |
268435456 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000090E:0001 |
NULL |
5 |
2 |
285212672 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000090E:0001 |
NULL |
5 |
2 |
301989888 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000090E:0001 |
NULL |
5 |
2 |
318767104 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000090E:0001 |
NULL |
5 |
2 |
335544320 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:00000916:0001 |
NULL |
5 |
2 |
352321536 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:00000916:0001 |
NULL |
5 |
2 |
369098752 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:00000916:0001 |
NULL |
5 |
2 |
385875968 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:00000916:0001 |
NULL |
5 |
2 |
402653184 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000091E:0001 |
NULL |
5 |
2 |
419430400 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000091E:0001 |
NULL |
5 |
2 |
436207616 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000091E:0001 |
NULL |
5 |
2 |
452984832 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000091E:0001 |
NULL |
5 |
2 |
469762048 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:00000926:0001 |
NULL |
5 |
2 |
486539264 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:00000926:0001 |
NULL |
5 |
2 |
503316480 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:00000926:0001 |
NULL |
5 |
2 |
520093696 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:00000926:0001 |
NULL |
5 |
2 |
536870912 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000092E:0001 |
NULL |
5 |
2 |
553648128 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000092E:0001 |
NULL |
5 |
2 |
570425344 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000092E:0001 |
NULL |
5 |
2 |
587202560 |
16 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000092E:0001 |
NULL |
5 |
2 |
603979776 |
64 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:00000936:0001 |
NULL |
5 |
2 |
671088640 |
64 |
0 |
0 |
0 |
0 |
00000000:00000000:0000 |
00000059:0000093D:0001 |
NULL |
Notice most 64MB growths resulted in 4 x 16MB VLFs.