Solved

SQL Server msdb

Posted on 2008-06-10
3
590 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
ID: 21755780
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
ID: 21761545
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
ID: 21761722
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Getting the 3 middle digits 4 37
MS SQL 2005 Srink database in chunks 4 58
SQL Select - Finding chars in a column 2 62
Replace Dates in query 14 40
This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

809 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