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
Thanks & fixed.
Thanks & Fixed
I have a doubt in the very first statement of the article. Does a database has more than one log file?
Yes can have. Doesn’t help in performance but some DBAs add it for safety purposes. Lets say you have one log file on a LUN and it runs out of disk space, you can add another log file on a different LUN, so on.