Link to home
Create AccountLog in
Avatar of ksfok
ksfok

asked on

SQL Server msdb

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.

Avatar of sbagireddi
sbagireddi

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



Avatar of ksfok

ASKER

But excuse me. What does the number list exactly mean? How can it be applied?
ASKER CERTIFIED SOLUTION
Avatar of sbagireddi
sbagireddi

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer