Last active
July 3, 2018 08:52
-
-
Save BipulRaman/e703ff6838439077cc9469a2e8001b05 to your computer and use it in GitHub Desktop.
www.bipul.in | Trunckate Database Logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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