Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We run an SBS 2008 server with WSS. On the drive I have set aside for WSS, I'm fast running out of space due to the ShareWebDb_log.ldf file:

File size is huge compared to the actual sharepoint site (15 GB)

I've tried doing to do what I've read online - change the recovery mode, backup and truncate - but I can't actually see how I do this via the SQL Server Management Studio tool. Can anyone shed any light?

ShareWebDb_log.ldf is not listed in the databases list

The database for this file does not show in the list, and I cannot expand Management > SQL Server Logs.

share|improve this question

Well, a few things.

  1. Logs are not the same as transaction logs. You can't expand Management > SQL Server Logs because it's empty. You evidently aren't logging any SQL server events. This is something completely different from a database's transaction logs.

  2. To do it through the GUI (more easily), right click the database in question, and go Tasks -> Shrink -> Files, and select the the log type in the ensuing dialogue.

    • Shrink

  3. Doing a backup with the database in Full recovery mode should shrink the log file as well, and this is actually the preferred/best practice way of keeping those log files small.

    • If you're not doing so already, you really should use a maintenance plan to regularly backup your Sharepoint databases. It keeps the log files from running away, as well as giving you a backup for when things go sideways. And with Sharepoint, they always do.

    • Occasionally taking the database offline will help truncate the logs the most if you really need the space (as parts of the transact logs in use, or flagged as in use, won't be purged after a backup).

  4. As is usually the case, if all else fails, there's a command-line option. (New Query button.)

    • Since the bloody markdown's giving me a migraine trying to post it here correctly, a blog with the code and an image of the text.
    • Markdown rapes neurons.
share|improve this answer
Thank you, option 4 (and only option 4) worked for me. Copy-Paste query: USE ShareWebDb GO DBCC SHRINKFILE(ShareWebDb_log, 1) BACKUP LOG ShareWebDb WITH TRUNCATE_ONLY DBCC SHRINKFILE(ShareWebDb_log, 1) GO – ArendE May 19 at 14:00
up vote 0 down vote accepted

I've stumbled upon full instructions for anyone looking for the answer:

Essentially, you expand the ShareWebDB node in SQL Mgmt Studio and you can shrink Files, rather than Databases.

share|improve this answer
I don't know why this got downvoted (it's a perfectly acceptable answer), and with databases like SharePoint's the, transaction logs often get very large due to whitespace, which the shrink command will eliminate. – HopelessN00b Sep 23 '12 at 8:00
Thanks, I wondered why myself.. – pierre Sep 24 '12 at 8:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.