Skip to content

Instantly share code, notes, and snippets.

@BipulRaman
Last active July 3, 2018 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BipulRaman/e703ff6838439077cc9469a2e8001b05 to your computer and use it in GitHub Desktop.
Save BipulRaman/e703ff6838439077cc9469a2e8001b05 to your computer and use it in GitHub Desktop.
www.bipul.in | Trunckate Database Logs
USE WSS_Content_DB
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE WSS_Content_DB
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (WSS_Content_DB_Log, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE WSS_Content_DB
SET RECOVERY FULL;
GO
-- In case you are not able to find Log file name, try below command.
-- SELECT * FROM WSS_Content_DB.dbo.sysfiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment