Click here to Skip to main content
Click here to Skip to main content

Tagged as

Transaction Log Full Issue in SQL Server

, 8 Oct 2013
Rate this:
Please Sign up or sign in to vote.
This tip discusses about the transaction log full issue in SQL Server

Introduction 

Let me discuss some basic point about transaction log file full problem in SQL Server. Generally there should scheduled transaction log backups to avoid this problem as database recovery model we maintain FULL. 

Listed below are some regular scenarios when transaction log file of SQL Server database grows: 

  • If there are no scheduled log backups or log backups are not working. 
  • If there are active transactions in the log file
  • If there are long running queries
  • In database mirroring if mirror server fails
  • In replication if distributor fails
  • If there is no disk space to grow the Transaction Log file
  • If bulk data was imported without dividing into multiple batches or transactions. 

Troubleshooting

  1. Check why log file cannot be reused using the following query:
    select name, log_reuse_wait_desc from sys.databases where name='dbname'
  2. Depending on the 2nd column value, we have to troubleshoot by using the following solutions:
    • Backing up the log (in case of the above scenario)
    • Freeing disk space so that the log can automatically grow
    • Moving the log file to a disk drive with sufficient space
    • Increasing the size of a log file
    • Adding a log file on a different disk
    • Troubleshoot replication or mirroring issue

Sample Scenario

We can check why the transaction log is full as follows:

We can take log backup to truncate the log file in the above scenario.

Scenario 2

Here transaction log file is growing due to replication failure. We have to troubleshoot the replication issue.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Kareem.S
Instructor / Trainer OptimizeSQL Technologies
India India
Mr. Kareem Syed is a senior SQL Server Trainer and working as Technical Consultant.
 
You can visit my blog at
www.optimizesql.blogspot.in
Follow on   Twitter

Comments and Discussions

 
QuestionMy vote of 1 PinmemberRob Eckert8-Oct-13 16:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 9 Oct 2013
Article Copyright 2013 by Kareem.S
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid