Technical Article

An easy way to track the growth of your database

,

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.

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

Rate

4.45 (51)

You rated this post out of 5. Change rating

Share

Share

Rate

4.45 (51)

You rated this post out of 5. Change rating