Solved

excessively large sql server log file

Posted on 2013-01-08
4
229 Views
Last Modified: 2013-01-09
I have a small mdf with a large ldf file. How can I reduce the size of the ldf. Some type of defrag or reindex or compact procedure. Please explain.
0
Comment
Question by:glenn_r
  • 2
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
Steve Wales earned 210 total points
ID: 38756909
Have just gone through a lot of this discussion in this question:
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL_Server_2008/Q_27988907.html

Have a read of these two blog posts:
http://www.sqlskills.com/blogs/kimberly/8-steps-to-better-transaction-log-throughput/
http://www.sqlskills.com/blogs/kimberly/transaction-log-vlfs-too-many-or-too-few/

It's all explained in there.

Make sure you're taking regular transaction log backups.

To fix (in shorthand):

Take full backup
Take log backup
Shrink log with dbcc shrinkfile
Grow again in chunks to appropriate size for your workload.
0
 
LVL 30

Expert Comment

by:Wayne Barron
ID: 38758135
#1, stay away from Shrinking your logs.
#2, go to the following article.
http://kb.cffcs.com/Main.asp?irid=193&Type=Article

Carrzkiss
0
 
LVL 22

Expert Comment

by:Steve Wales
ID: 38758726
I'm sorry, but I have to disagree with carrzkiss and the site he's directed you to.  Setting your databases to simple for a production database destroys the ability to perform point in time recovery.

Letting the system recreate your log file in this way means you have a small logfile with default sizing and then if you're in full recovery mode, as it grows you end up with log fragmentation and too many VLF's.

Shrinking log files is an acceptable practice.  Shrinking data files is something you want to stay away from.
0
 
LVL 30

Expert Comment

by:Wayne Barron
ID: 38759554
@sjwales
Yes, you are correct, I mis-spoke when I stated not to shrink the log files, I was thinking about the database itself.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

828 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