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

Anonymous

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

  1. Singam shetty Sri ganesh 80 Reputation points Microsoft External Staff Moderator

    Hello @MohanReddyYadamuri-2064,

    Thank you for posting your query and thanks to @Marcin Policht for sharing valuable insights.

    Could you kindly confirm whether the provided solutions have addressed your issue? Your feedback will assist other members who may face similar challenges.

  2. Singam shetty Sri ganesh 80 Reputation points Microsoft External Staff Moderator

    Hello @MohanReddyYadamuri-2064,

    We hope you're doing well. Could you please confirm whether your issue has been resolved or if you're still facing challenges?

    Thank you.


Sign in to comment

Answer recommended by moderator

Marcin Policht 92,630 Reputation points MVP Volunteer Moderator
  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

  1. Erland Sommarskog 134.7K Reputation points MVP Volunteer Moderator

    👁 User's image

    This is a horrible idea! If you backup the transaction log WITH INIT to the same location, you breaking your log chain. DON'T DO THIS!


Sign in to comment

0 additional answers

Sign in to answer

Your answer