Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 673
  • Last Modified:

Error: Transaction log for database is full

Error at Destination. The transaction log for database is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases

Where do I look for this?
0
qbjgqbjg
Asked:
qbjgqbjg
  • 6
  • 4
1 Solution
 
dqmqCommented:
select name,  log_reuse_wait_desc from sys.databases
0
 
qbjgqbjgConsultantAuthor Commented:
It says NOTHING. So how do I change it and what should I change it to so log will be reused/
0
 
dqmqCommented:
First, check the database properties to see if you are using simple recovery mode or full recovery mode.

If simple, then you have a long-running transaction that is not ending.  Find it and end it.  Restart the the dbms if necessary.

If full, then do a log backup.  

Also, curious if you are using mirroring, replication, or distributed transactions.  
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
qbjgqbjgConsultantAuthor Commented:
I really don't know about the mirroring, replication, or distributed transactions. I am very new to SQL.
0
 
qbjgqbjgConsultantAuthor Commented:
I went to the database properties. Then options, under recovery it says Page Verify CHECKSUM. Under mirroring it says This database has not been configured for mirroring.
0
 
dqmqCommented:
On the options tab, it's near the top. Look for-->Recovery Model:
0
 
Fahad PathanCommented:
shrink the transaction files i.e ldf file.
0
 
qbjgqbjgConsultantAuthor Commented:
Recovery Model says Bulk-logged.
0
 
qbjgqbjgConsultantAuthor Commented:
Is there a way to make it wrap on the log file and reuse it when it fills up?
0
 
qbjgqbjgConsultantAuthor Commented:
Based on this information below I set Recover to SIMPLE
:
With the Full or Bulk-Logged recovery mode, inactive transactions remain in the transaction log file until after a Checkpoint is processed and a transaction log backup is made.  Note that a full backup does not remove inactive transactions from the transaction log.  The transaction log backup performs a truncation of the inactive portion of the transaction log, allowing it to be reused for future transactions.  This truncation does not shrink the file, it only allows the space in the file to be reused (more on file shrinking a bit later).  It is these transaction log backups that keep your transaction log file from growing too large.  An easy way to make consistent transaction log backups is to include them as part of your  database maintenance plan.

If your database recovery model is set to FULL, and you’re not creating transaction log backups and never have, you may want to consider switching your recovery mode to Simple.  The Simple recovery mode should take care of most of your transaction log growth problems because the log truncation occurs after the Checkpoint process.  You’ll not be able to recover your database to a point in time using Simple, but if you weren’t creating transactional log backups to begin with, restoring to a point in time wouldn’t have been possible anyway.  To switch your recovery model to Simple mode, issue the following statement in your database.

ALTER DATABASE YourDatabaseName
SET RECOVERY SIMPLE
0
 
dqmqCommented:
Wow! I never bothered to mention THAT recovery model because it's so rare to encounter a database in that mode.  Glad you found it.    But don't quit now. Please read up on recovery models and make sure to choose FULL or SIMPLE based on the business requirements.  And if you choose FULL, then you need a companion strategy for log backups.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now