3

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.

2 Answers 2

4
+75

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.
1
  • 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, 2016 at 14:00
0

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

Link

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

1
  • 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. Sep 23, 2012 at 8:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .