Hi Friends,

Today, I am going to explain the internal of SQL Server database transaction log files architecture by using DBCC LOGINFO.

Our Transaction log file is just divided into multiple Virtual Log Files known as VLFs. We cannot configure the number of VLF files and the size of VLF Files. When we create a new database then number of virtual log file depends on the initial size Transaction Log file i.e

Case 1 : Number of VLF files are 4 when Transaction Log Size is less than or equals to 64 MB

1_SQL Server_Database_Transaction_Log_Virtual_Log_Files_Circular_Behavior_Part1

Case 2: Number of VLF files are 8 when Transaction Log Size is greater than 64 MB and less than or equals to 1 GB

After creating the above datbase now just chcek the architecture of Log file by running DBCC LOGINFO.The below mention output showing that there are eight VLF files.

2_SQL Server_Database_Transaction_Log_Virtual_Log_Files_Circular_Behavior_Part1

Case 3: Number of VLF files are 16 when Transaction Log Size is greater than 1 GB

After creating the above datbase now just chcek the architecture of Log file by running DBCC LOGINFO.The below mention output showing that there are sixteen VLF files.

3_SQL Server_Database_Transaction_Log_Virtual_Log_Files_Circular_Behavior_Part1

The output of DBCC LOGINFO contains following columns:

1-  FileId : represent log file identifier

2-  FileSize: Size of Virtual Log File

3-  StartOffset: beginning of VLF in terms of bytes

4-  FSeqNo: VLF Sequence number

5-  Status: 0 represent inactive, 2 represents active

6-  Parity: parity information,value may be 0 or 64 or 128

7-  CreateLSN: Log Sequence No. from which VLF begins.

 

Regards

Prince Rastogi

Like us on FaceBook Follow us on Twitter | Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook