Sql-server – delete a large LDF file in SharePoint

sharepointsql serversql-server-2005

I've got a LDF file within my SQL 2005 path for SharePoint. It's 5.8 GB in size. Can I move it or delete it without killing my SharePoint data??

Best Answer

LDF files are the transaction log files for SQL server. I would not delete it directly, but rather..

1. Right click WSS_Content and choose Tasks -> Backup
2. Select backtup type "Transaction log", select destination backup file and click Ok.
3. After backing up the DB, right click WSS_Content and choose Tasks -> Shrink -> Files
4. Select the type log and shrink action (eg release unused space)

If you don't need the transaction log, you can alter your database to use a 'Simple' rather than 'Full' recovery model, which will not keep these large files around. MSDN Link

FAIR WARNING: Always have a backup of your database/data/settings before you start mucking with it.