Monday, 1 June 2020

The transaction log for database 'database name' is full due to 'LOG_BACKUP'.


Query to fix this  
 
USE [Database Name]
GO  -- Truncate the log by changing the database recovery model to SIMPLE.  ALTER DATABASE [Database Name]
SET RECOVERY SIMPLE
GO  -- Shrink the truncated log file to 1 MB. 
DBCC SHRINKFILE ('Logical name of the transaction log',1); 
GO  -- Reset the database recovery model. 
ALTER DATABASE [Database Name]
SET RECOVERY FULL
GO
 
Query to get the logical name of the transaction log
 
USE [Database Name]
GO
SELECT name
FROM sys.master_files
WHERE database_id = db_id() AND type = 1
 
OR
 
USE [Database Name]
GO
SELECT Name
FROM sys.database_files

 

No comments:

Post a Comment