Singh Singh - 19 days ago 4x
SQL Question

How can we identify used space in log file?

Is there any way in SQL Server to identify used space in log files using SQL-query?


use dbcc command

  dbcc Sqlperf('logspace')

On My local Machine,it gave the following..

Database Name      Log Size (MB)    Log Space Used (%)  Status
master                1.242188        50.9434             0
tempdb                0.7421875       63.81579             0
model                 0.4921875       81.74603             0
msdb                  1.992188        33.92157             0

If you want to know VLF count for each log file and status of each VLF(active portion or inactive portion of log),you can use below as well,but this is database specific

Dbcc loginfo