1

My sql database .mdf file is 130mb and .ldf file is 1300mb. I want to reduce my .ldf file size. How can I do it and is there any problem occur after deleted data.

Thanks in advance

  • Either SF (again) or duplicate of soemthing asked a few hours ago http://stackoverflow.com/questions/4731500/is-the-size-of-log-file-effecting-performance-of-the-database-how-to-shrink-log/4731507#4731507 – gbn Jan 19 '11 at 06:45
  • Possible duplicate of [How do I decrease the size of my sql server log file?](https://stackoverflow.com/questions/829542/how-do-i-decrease-the-size-of-my-sql-server-log-file) – underscore_d Apr 18 '18 at 13:36

1 Answers1

1

To start with, do a full backup, a log backup, and then set up scheduled log backups if you haven't done so already. After a few log backups you can shrink the log file and hopefully it won't grow that large again (unless you do some really unusual updates that touch a lot of data over and over again).

See http://msdn.microsoft.com/en-us/library/ms189275.aspx for more info on the different SQL Server recovery modes and backup requirements.

KristoferA
  • 12,287
  • 1
  • 40
  • 62
  • what problems can occur when shrinking the data – Dinesh Kumar Jan 19 '11 at 07:01
  • Normally none (unless you have a hardware failure or power outage while shrinking the log). But if the log has grown that large, you're most likely running in full recovery mode without backups. In order to be able to shrink it in the first place you need to set up backups and/or change recovery mode. See my link to msdn, and the other SO question linked to in gbn's comment. – KristoferA Jan 19 '11 at 07:16