Monday, June 18, 2012

Shrink SharePoint Config Log files

1. Backup your sharepoint config log files.
2. Execute the query belowusing Microsoft SQL Server Management Studio.

Note: change to your specific sharepoint config file names.

USE SharePoint_Config
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE SharePoint_Config
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 50 MB.
DBCC SHRINKFILE (SharePoint_Config_log, 50);  -- here 2 is the file ID for trasaction log file,you can also mention the log file name (dbname_log)
GO
-- Reset the database recovery model.
ALTER DATABASE SharePoint_Config
SET RECOVERY FULL;
GO

No comments:

Post a Comment