Categories: SQL Queries

How to check transaction log file size in Sql server

In SQL server to check transaction log file size you can simply run this dbcc sqlperf(“logspace”) . This query will provide you the transaction log usage statistics for all the databases.

 

How to check transaction log file size in Sql server

The other way round is to run this DMV query which will provide you the usage for the selected database. Note,this will provide you usage only for the

selected database.

Use tempdb

SELECT total_log_size_in_bytes *1.0/1024/1024 AS [ Total log space in MB],
used_log_space_in_bytes *1.0/1024/1024 AS [ Used log space in MB],
(total_log_size_in_bytes – used_log_space_in_bytes)*1.0/1024/1024 AS [free log space in MB]
FROM sys.dm_db_log_space_usage;

 

How to check transaction log file size in Sql server

 

 

 

 8,683 total views,  9 views today

admin

Recent Posts

What is slow changing dimension?

The attribute value in Dimension table are going to change slowly over time and they…

5 years ago

How to Change SQL Server Compatibility level

  Changing Database compatibility level will be required when you upgrade your database from one…

6 years ago

View Compatibility level of Database

To know what is compatibility Level check this post link. You can view the compatibility…

6 years ago

SQL Server Compatibility Level

SQL Server Compatibility level will be used to decide how SQL will use it features.…

6 years ago

View in SQL server

A view is a virtual table.  View will not store any data physically. The data…

6 years ago

SSIS :The package failed to load due to error 0xC0011008

Below is the error which I was getting today while deploying the SSIS pacakge for…

6 years ago