top of page
Writer's pictureKunal Ranpura

SQL Server Find Transactional Log Size and Used Percentage

-- Get transaction log size and space information for the current database

SELECT DB_NAME(database_id) AS [Database Name], database_id,

CAST((total_log_size_in_bytes/1048576000.0) AS DECIMAL(10,1)) AS [Total_log_size(GB)],

CAST((used_log_space_in_bytes/1048576000.0) AS DECIMAL(10,1)) AS [Used_log_space(GB)],

CAST(used_log_space_in_percent AS DECIMAL(10,1)) AS [Used_log_space(%)]

FROM sys.dm_db_log_space_usage WITH (NOLOCK) OPTION (RECOMPILE);


-- Another way to look at log file size and space

17 views0 comments

Recent Posts

See All

SQL Server Profiler Trace

--Import multiple trace file in sql Table. --All the rollover files will be automatically imported --provide number tracefile to capture...

SQL Replication Mark Transaction as commit

--SQL Server Database log full due to replication, you can run the following command to mark all ---the replication transaction is done,...

Comentarios


bottom of page