Solved

Database Log growth question

Posted on 2008-10-08
9
239 Views
Last Modified: 2012-05-05
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
Comment
Question by:Rouchie
  • 3
  • 3
  • 3
9 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 200 total points
Comment Utility
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
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
>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
 
LVL 25

Author Comment

by:Rouchie
Comment Utility
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
 
LVL 60

Assisted Solution

by:chapmandew
chapmandew earned 300 total points
Comment Utility
The backup itself does not shrink the file.  To shrink the file, you would need to use dbcc shrinkfile.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 25

Author Comment

by:Rouchie
Comment Utility
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
 
LVL 60

Assisted Solution

by:chapmandew
chapmandew earned 300 total points
Comment Utility
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
 
LVL 25

Author Comment

by:Rouchie
Comment Utility
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
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
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
 
LVL 60

Assisted Solution

by:chapmandew
chapmandew earned 300 total points
Comment Utility
40MB is in no way a huge file. ;)

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now