Today I was asked to solve a SQL 2005 issue related to transaction log size. One of our senior developers recived the following error:
The error message states that we should check the sys.databases table for details of the error like so:
SELECT log_reuse_wait_desc
SELECT log_reuse_wait_desc
FROM master.sys.databases
WHERE ([name] = N'MyDbName')
which returns the following:
which returns the following:
log_reuse_wait_desc
------------------------------------------------------------
LOG_BACKUP
Now the interesting thing is that the LOG file was configured with unrestricted growth and was only 1.3GB. The reason the error was thrown was because the disk had run out of space so it could not grow.
Since the database in question was a WSS config db, it didn't need FULL recovery so to resolve the error I simply truncated the log, set the recovery mode to simple and reduced the log file size to 10MB:
Now the interesting thing is that the LOG file was configured with unrestricted growth and was only 1.3GB. The reason the error was thrown was because the disk had run out of space so it could not grow.
Since the database in question was a WSS config db, it didn't need FULL recovery so to resolve the error I simply truncated the log, set the recovery mode to simple and reduced the log file size to 10MB:
BACKUP LOG [MyDbName] WITH TRUNCATE_ONLY
GO
ALTER DATABASE [MyDbName] SET RECOVERY SIMPLE
GO
USE [MyDbName]
GO
DBCC SHRINKFILE(2,10)
GO
Problem solved.
Problem solved.