SQL SERVER – Detect Virtual Log Files (VLF) in LDF

Posted by pinaldave on SQL Authority See other posts from SQL Authority or by pinaldave
Published on Thu, 30 Dec 2010 01:30:08 +0000 Indexed on 2010/12/30 2:56 UTC
Read the original article Hit count: 356

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

© SQL Authority or respective owner

Related posts about Pinal Dave

Related posts about sql