Shrink SQL Database in Using SQL Query

How to fix this ‘The transaction log for database ‘Search_Service_DB’ is full due to ‘LOG_BACKUP’.?

On your SQL Server, open the SQL Server Management Studio.  Connect to the local SQL Server.  Right click Search_Service_DB -> Properties -> Options.  Change Recover Model from Full to Simple.  Click OK.  Right click Search_Service_DB, go to Tasks -> Shrink -> Shrink Files.  Select a File type of Log, then Shrink.

OR below SQL queries:


GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE YourDataBaseName
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (YourDataBaseName, 1024);
GO
-- Reset the database recovery model.
ALTER DATABASE YourDataBaseName
SET RECOVERY FULL;
GO

Shrink SQL Database in Using SQL Query

Leave a Reply

Scroll to top