SQL SERVER – Detect Virtual Log Files (VLF) in LDF
- by pinaldave
In one of the recent training engagements, I was asked if it true that there are multiple small log files in the large log file (LDF). I found this question very interesting as the answer is yes. Multiple small Virtual Log Files commonly known as VLFs together make an LDF file. The writing of the VLF is sequential and resulting in the writing of the LDF file is sequential as well. This leads to another talk that one does not need more than one log file in most cases.
However, in short, you can use following DBCC command to know how many Virtual Log Files or VLFs are present in your log file.
DBCC LOGINFO
You can find the result of above query to something as displayed in following image.
You can see the column which is marked as 2 which means it is active VLF and the one with 0 which is inactive VLF.
Reference: Pinal Dave (http://blog.SQLAuthority.com)
Filed under: Pinal Dave, SQL, SQL Authority, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology