Solved

Can you compact a Microsoft Internal Database

Posted on 2012-04-03
7
707 Views
Last Modified: 2013-01-10
Hello everyone, we are running SharePoint Services 3.0 and it is using Microsoft Internal Database and the size of some of the files have grown way out of control I think. Is there a way to compress them or clean them up?

Location of files....
C:|Windows\SysMSI\SSEE\MSSQL.2005\MSSQL\Data
Files that are in question...
CompanyDatabaseSharePoint.mdf (6,092,992 KB)
CompanyDatabaseSharePoint_log.LDF (60,736,000 KB)
SharePoint_Config_Random Letter/Numbers_log.LDF (19,352,192 KB)
WSS_Content_log.LDF (3,164,032 KB)
WS_Search_ServerName_log.LDF (2,160,960 KB)

As you can see those files are taking up almost 90 GB and our entire site is only about 5 GB total. Can anyone help me clean this up? Thank you in advance for your help!!
0
Comment
Question by:CCG3
  • 4
  • 3
7 Comments
 
LVL 38

Accepted Solution

by:
Justin Smith earned 500 total points
ID: 37801624
First you must install SQL Manager Express to manage the databases (if you don't have it already).  It's a free download from Microsoft.

Once connected to your internal db instance, you should probably right click on all your SP databases - Properties, go to Options and change the recovery model to SIMPLE.  This will prevent you .ldf files from growing and growing.

Wait about 10 minutes after setting the recovery model.  Now, to shrink the ldf files down, right click CompanyDatabaseSharePoint and do New Query.

dbcc shrinkfile('companydatabasesharepoint_log',2000)

You will probably have to run the above a few times to get it shrunk all the way down.  The final size should be around 2 GB.  Now do the same for the config db.
0
 
LVL 38

Expert Comment

by:Justin Smith
ID: 37801636
The reason why these ldf files get so big, is when the recovery is set to FULL, all database transactions are written to the log file (ldf) and remain there until the log is backed up.  If it is never backed up, it just grows and grows.

Either backing up the log file regularily (which truncates it), or setting the recovery to SIMPLE will prevent this in the future.  On internal db's, I usually just go to SIMPLE as you can't create management plans to regularily backup the logs (unless you know tsql).
0
 

Author Comment

by:CCG3
ID: 37805729
Thanks for the replies! I have a test machine up now and I have restored SharePoint and I am trying to do what you are suggesting in a test environment first. I have installed SQL Server Management and I am trying to open those log files but I am getting sharing violation error. I have stopped the website from running and I changed the server type to SQL Server Type to SQL Server Compact Edition. But when I select one of those files I get the error.

Cannot connect to C:\Windows\SysMSI\SSEE\MSSQL.2005\MSSQL\Data\WSS_Content_log.LDF

There is a file sharing violation. A different process might be using the file.

Can someone tell me what I am doing wrong please? Thank you for your help!
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:CCG3
ID: 37805930
0
 

Author Comment

by:CCG3
ID: 37812185
Hey everyone, I have done exactly what you all have suggested and my files are no smaller.

I installed SQL Manager Express.
I opened the databases, I went to Properties\Options, I changed the Recovery Mode from Full to Simple.
I waited 20 minutes, then ran some new quires and nothing has changed.

Does anyone have any other suggestions?
0
 

Author Comment

by:CCG3
ID: 37812278
Never mind, again.

It was all me. I forgot to run the query. thank you for your help!!
0
 
LVL 38

Expert Comment

by:Justin Smith
ID: 37812279
You've missed something or misstyped the query.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Lync server 2013 Backup Service Error ID 4049 – After File Share Migration
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now