7

Possible Duplicate:
Why Does the Transaction Log Keep Growing or Run Out of Space?

My .ldf file size keeps increasing. I already tried to shrink it but after that it just grows again. How can I permanently limit the filesize or perhaps even disable it entirely (since I don't think I'll ever use it).

Adam
  • 245
  • 2
  • 4
  • 11

2 Answers2

12

You cannot disable/remove the LDF file. It has to exist, as it stores database transactions. What you can do is:

  1. Set the database recovery model to Simple

This should keep your LDF file from growing, and is set via the Options page of the Database Properties dialog.

For additional reducing, which I don't think is necessary, you can:

2 Set Auto Shrink to True

This is also done from the Options page of the Database Properties dialog:

enter image description here

3 Turn auto-grow off

This is done from the Files page of the Database Properties dialog:

enter image description here

Be aware that when a database is in the Simple recovery model, you will not be able to recover to a point in time

Or

  1. Set the database recovery model to Full (I guess it's already set this way)
  2. Create a full database backup
  3. Start creating transaction log backups regularly. It's best to schedule a SQL Server job to do this

The latter scenario provides better disaster recovery as it enables recovery to a point in time It's up to you to decide how much data you can afford to lose

Carol Baker West
  • 1,616
  • 14
  • 13
-1

You can take a look at the answers I received and posted in this thread: SQL Server virtual log size

I'm not sure if it's possible to disable the log completely, but the way I solved it has kept the logs from growing out of control.

Petter Brodin
  • 897
  • 2
  • 11
  • 18