Solved

SQL Server msdb

Posted on 2008-06-10
3
558 Views
Last Modified: 2008-10-07
A SQL Server article says:

"Frequently you'll want to know how fast your database has been growing. Ideally, you'll have historical size information on all the databases that you work on. In the real world, however, this is not necessarily the case.

What we have most often is the backup history. Luckily, we can get a rough outline of the growth of your database, over time, from the msdb..backupset table. This query will give the size of the backup, every time that a backup was done. From this you can get a pretty good idea of how fast your database is growing."

The above statement is followed by the following T-SQL query:

select
 BackupDate = convert(varchar(10),backup_start_date, 111)
 ,SizeInGigs=floor( backup_size/1024000000)
from msdb..backupset
where
 database_name = 'DatabaseName'
 and type = 'd'
order by
 backup_start_date desc


Please advise how to interpret the result. Thanks.

0
Comment
Question by:ksfok
  • 2
3 Comments
 
LVL 8

Expert Comment

by:sbagireddi
Comment Utility
This gives you the size in gigs of a particular database ..say 'pubs' in starting from today to about a month.
The backup_size/1024000000 converts the size from bytes to gigabytes.

So for eg I ran it on one of our dbs:

2008/06/10      0
2008/06/10      13
2008/06/10      0
2008/06/09      2
2008/06/09      52
2008/06/09      11
2008/06/09      0
2008/06/09      0
2008/06/09      14



0
 

Author Comment

by:ksfok
Comment Utility
But excuse me. What does the number list exactly mean? How can it be applied?
0
 
LVL 8

Accepted Solution

by:
sbagireddi earned 500 total points
Comment Utility
The numbers are the size in Gigabytes for the database backup  on that particular day.

Just a means for you to track the database size and estimate how much hard drive space you might need.

So for eg :If the backup increases by 10% every month, then you can expect the size to double in 10 months and accordingly you can size you hard drive or buy extra or new hard drives.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 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

12 Experts available now in Live!

Get 1:1 Help Now