Sunday, May 31, 2020

SQL Database Growth History and Prediction/Forecast/Projection

To find the growth of a database from backup size.


Use mydatabase
SELECT    [Backup_Date] = CONVERT(varchar(10),backup_start_date, 111),
        [Size (MB)] = FLOOR([backup_size]/1024./1024.)
FROM    [msdb].[dbo].[backupset]
WHERE    [database_name] = DB_NAME()
AND        [type] = 'd'
ORDER BY [backup_start_date] DESC



Copy the result with headers and paste in Excel

Select both columns and select line graph.

No comments:

Post a Comment