In the data access layer of my teams ASP.NET application, I run stored procedures against our database through the use of the .NET SQLClient. After adding new code to allow an insert operation on the database, I tested the code, and received the following exception:
The transaction log for database 'DBName' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases
I verified that I receive the same message when attempting insert operations from within MS SQL Server Management Studio. I was concerned because I recently added three two triggers two the database to perform some insertion of data based on insert and update to certain tables, and I thought potentially I had incurred an infinite loop or something of that nature.
However, based on other instances of this problem online, it does not seem like a problem generally caused by triggers or a spinning query. I queried against the log_reuse_wait
and log_reuse_wait_desc
columns and returned the following:
2 | LOG_BACKUP
Also, the query SELECT [name], recovery_model_desc, log_reuse_wait_desc
returns:
FROM sys.databases
name | recovery_model_desc| log_reuse_wait_desc
DBName| FULL | LOG_BACKUP
In which the first column is log_reuse_wait
and the second is log_reuse_wait_desc
.
Based on the definitions for the codes on msdn , I need to perform a log backup and then the log can be automatically truncated, allowing for further operations on the database. Is that a correct assumption? Is this something that could be caused by incorrectly coded triggers, or is more of a routine maintenance task, incurred by numerous transactions on the database?
EDIT:
The query select type_desc, size, max_size from sys.database_files
returns:
type_desc | size | max_size
1| ROWS | 512 | -1
2| LOG | 64 | -1