how to avoid incidents on Drive getting full due to transaction log getting full

MohanReddyYadamuri-2064 0 Reputation points
2025-09-17T06:02:49.3933333+00:00

We have been observing that the G-Drive log on the SQL server is filling up frequently in our SQL Server eventhou we have configured log drive double in size of data drive

SQL Server Database Engine
{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 63,730 Reputation points MVP Volunteer Moderator
    2025-09-17T11:32:58.62+00:00
    1. Check recovery model
    • Full Recovery model keeps all log entries until a log backup occurs.
    • If you don't take regular log backups, the log will just keep growing. If you don't need point-in-time recovery, consider switching to Simple Recovery Model.
    ALTER DATABASE [YourDB] SET RECOVERY SIMPLE;
    
    1. Schedule regular log backups
    • If you need Full Recovery, you must run transaction log backups frequently.
    • This truncates inactive portions of the log and prevents growth. Example SQL Agent job:
    BACKUP LOG [YourDB] TO DISK = 'E:\SQLBackups\YourDB_Log.trn' WITH INIT;
    

    Schedule every 15 minutes (or based on workload).

    1. Monitor log reuse waits

    Check why the log isn't being reused:

    DBCC SQLPERF(LOGSPACE);
    SELECT name, log_reuse_wait_desc 
    FROM sys.databases;
    

    Common blockers:

    • LOG_BACKUP → No log backup taken
    • ACTIVE_TRANSACTION → A long-running transaction is preventing truncation
    • REPLICATION → Replication not keeping up
    • AVAILABILITY_REPLICA → AG/replica sync issues
    1. Manage long-running transactions
    • Open transactions (ETL, batch jobs, index rebuilds) keep log records until they finish.
    • Identify them with:
    DBCC OPENTRAN([YourDB]);
    
    1. Size and autogrowth settings
    • Pre-size log file to expected needs rather than letting it grow in small increments.
    • Avoid percentage autogrowth; use fixed MB growth (e.g., 512MB).
    1. Regular maintenance
    • Ensure index maintenance and large updates are batched to avoid massive log usage.
    • If rebuilding indexes, consider ONLINE = ON and SORT_IN_TEMPDB = ON to reduce log impact.

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.