Hi Friends,

We can have more than one log file for a database. However, in many cases a single log file suffices. Logically, a log file is divided into a number of virtual log files. The virtual log file concept allows SQL Server to manage various operation on the log file, including checkpoints, various phases of revovery like Analysis, Undo & Redo. With the help of Virtual Log Files (VLFs), potions of the Log file is marked as Active, Recoverable, Reusable & Unused. The number of VLFs can go into hundreds (but not advisable). When a log file grows and when it is shrunk, it is always in units of VLFs. We can observe the virtual log file using SQL Server DBCC LOGINFO statement.

USE AdventureWorks2008
GO
DBCC LOGINFO

 

SQL Server DBCC LOGINFO

 

 

Data Platform Virtual Summit 2020

Subscribe to SQLMaestros YouTube channel. If you want more learning content in your inbox, subscribe to SQLMaestros Bulletin.

SQLMaestros YouTube | SQLMaestros Bulletin | SQLMaestros Twitter