DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 2000544 - Last Review: April 30, 2012 - Revision: 8.0

Symptoms

The Windows SharePoint Services 3.0 (WSS) log file may grow to a large size on a default installation of Windows Small Business Server 2008 (Windows SBS). The Windows SBS Best Practices Analyzer (BPA) reports the following warning message:

 

Sharepoint Config database log file getting large

The Windows SharePoint Services configuration databases log file is getting large (currently over 1gb in size)

 

Cause

This will occur if the database is configured to use the default setting of full recovery mode and numerous transactions have been logged to the database.

Resolution

To reduce the size of the log file, follow these steps. 

Note It's a good idea to do a full server backup before you complete these steps.

We can help you reduce the size of the log file. To do this, go to the "Fix it for me" section. If you prefer to fix this problem yourself, go to the "Let me fix it myself" section.

Fix it for me

To fix this problem automatically, click the Fix this problem link. Then click Run in the File Download dialog box, and follow the steps in this wizard.

Fix this problem
Microsoft Fix it 50682



Note This wizard may be in English only, but the automatic fix also works for other language versions of Windows.

Note If you are not on the computer that has the problem, you can save the automatic fix to a flash drive or to a CD so that you can run it on the computer that has the problem.

Let me fix it myself

1. Start Notepad. To do this, click Start, point to All Programs, point to Accessories, and then click Notepad.

2. Copy and paste the following text into Notepad. Save the file as c:\logshrink.sql

declare @ConfigDB varchar(255);
declare @ConfigDBLog varchar(255);
declare @ConfigDBCmd varchar(255);
select @ConfigDB = name from sys.databases where name like 'SharePoint_Config_%';
set @ConfigDBCmd = 'BACKUP database [' + RTRIM(@ConfigDB) + '] to disk=''C:\windows\temp\before.bkf''';
execute(@ConfigDBCmd);
set @ConfigDBCmd = 'use [' + RTRIM(@COnfigDB) + ']';
execute(@ConfigDBCmd);
set @ConfigDBCmd = 'BACKUP LOG [' + RTRIM(@ConfigDB) + '] WITH TRUNCATE_ONLY';
execute(@ConfigDBCmd);
set @ConfigDBCmd = 'use [' + RTRIM(@COnfigDB) + ']';
execute(@ConfigDBCmd);
select @ConfigDBLog = name from sys.database_files where name like 'SharePoint_Config%_log';
set @ConfigDBCmd = 'use [' + RTRIM(@ConfigDB) + '] DBCC SHRINKFILE([' + RTRIM(@ConfigDB) + '_log],1)';
execute(@ConfigDBCmd);
set @ConfigDBCmd = 'BACKUP database [' + RTRIM(@ConfigDB) + '] to disk=''C:\windows\temp\after.bkf''';
execute(@ConfigDBCmd);
go

3. Open an elevated command prompt. To do this, follow these steps:

  1. Click Start, click All Programs, click Accessories, and then right-click Command Prompt.
  2. Click Run as administrator.  Note If you are prompted for an administrator password or for confirmation, type the password or provide confirmation.

4. At the command prompt, copy and paste (or type) the following command, and then press Enter:

sqlcmd -S \\.\pipe\mssql$microsoft##ssee\sql\query -E -i c:\logshrink.sql 

Note This script creates two backup files (before.bkf and after.bkf) in C:\windows\temp.

 


APPLIES TO
  • Windows Small Business Server 2008 Premium
  • Windows Small Business Server 2008 Standard
Keywords: 
kbsmbportal KB2000544
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support