Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Shrink LDF file (Sharepoint)

Author  Topic 

greenhill32
Starting Member

1 Post

Posted - 2012-08-29 : 05:01:55
Hi guys I am new to the forum and I could use some help.

I believe this is a SQL issue NOT Sharepoint so I will start here.

As I am sure you are aware some Sharepoint databases default to the full recovery option, Now some time down the road the LDF files are huge (40 Gig). The transaction logs had never been backed up hence their size.

We are now running out of disk space..

On some of the smaller log files I did do a transaction log back up and tried to shrink the file with the GUI and the
DBCC SHRINKFILE (N’WebAnalyticsServiceApplication_StagingDB_log’ , 1000)BUT it reduced a 4.5 gig LDF to about 4.3 gig.
Why did the LDF file NOT shrink.? by more than ~200 meg

As a last resort I could change the mode to simple and shrink the file, but this is a production DB. I do not think we need the point in time recovery that a full backup affords and simple would suffice but why wont the ldf files shrink?
Any advice gratefuly received.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-08-29 : 12:28:27
First of all, you need to start backing up the transaction logs on a frequent basis, such as every 15 minutes, if you are going to keep them at FULL recovery model. Otherwise, you are going to be fixing this all the time. FULL recovery model doesn't make sense unless you are backing up the transaction log.

Switching it to SIMPLE and then shrinking it would work. You could also just truncate the transaction log. However you need to fix the root cause of this issue and not just the disk space issue.

And it didn't shrink because it wants you to back it up first.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -