Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SQL Server msdb

Posted on 2008-06-10
3
602 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PERFORMANCE OF SQL QUERY 13 75
Impove long SQL Stored Procedure Performance 14 77
ms sql + top 1 for each customer 3 56
SQL Server Insert where not exists 24 46
by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

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