• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

Database Log growth question

When creating a new database using the New Database dialog window, there is an AUTOGROWTH option for the log file.

If I set a Restricted File Growth size of 20MB, what happens when the log file reaches its maximum size?  Do I start getting errors or does the log file start writing over itself?

Also, what would happen to an existing database log that has a current filesize of 40MB if I set its Restricted File Growth size to 20MB?
0
Rouchie
Asked:
Rouchie
  • 3
  • 3
  • 3
4 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
is your db in full recovery mode?
do you perform regular transaction log backup?

yes+yes => you should be safe, but still setting restricted growth is dangerous, as indeed whenever that size is reached, and more transactions are trying to write data there, they will fail.

yes+no => you have a problem anyhow, as you need regular t-log backup so that the log file space can be reused internally

no+xxx => similar to the yes+yes, as you might have many concurrent+large transactions requiring more than 20MB of transaction log space at the same time.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>Also, what would happen to an existing database log that has a current filesize of 40MB if I set its Restricted File Growth size to 20MB?

you cannot do that.
0
 
RouchieAuthor Commented:
Hi AngelIII

The database is in Full Recovery mode.  The thing is I haven't yet done any transactional log backups because I'm still trying to understand it all.
Am I right in thinking that a transactional log backup removes the entries from the log file into a separate backup file?  Would that type of backup therefore shrink the log file?
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
chapmandewCommented:
The backup itself does not shrink the file.  To shrink the file, you would need to use dbcc shrinkfile.
0
 
RouchieAuthor Commented:
Okay thanks for that.

If I backup the log, say, each month, then I presume the backup file filesize gets larger and larger?
So eventually there must come a point where older backups are not needed anymore.  Is that correct?  If so, can you just delete them from the backup or is that really risky?
0
 
chapmandewCommented:
IF you only backup the log once a month, you're not really solving any of your problems.  How often are you doing a full backup?  You can delete any transaction log backup files that were taken before the last full or differential backup.
0
 
RouchieAuthor Commented:
Its a funny one.  I've never really grasped the concept of transactional backups.

My web host does a daily file backup, so I never really thought about it.  Recently though I see the log file has grown to 40MB which makes it a real pain when I download to my development machine.

I really need to know the best way to backup the database data while not ending up with huge files.   Do you know of any links where I can read in detail about backing up and what happens with the backup files etc etc?  I've read books online but it presumes you are already a pro on this.  The stuff I found online only seems to cover a small part of the puzzle...
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
change the recovery mode to simply, I would say, unless you plan to run regular (=hourly) transaction log backups.
be aware that you will only be able to run full restores, then, as a consequence.
0
 
chapmandewCommented:
40MB is in no way a huge file. ;)

Create a database maintenance plan.
http://blogs.techrepublic.com.com/datacenter/?p=248
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now