How can I calculate how much storage I need to store a full backup on all my sql databases

I am preparing to upgrade our ERP system, I have 491 databases to backup before I run the proccess.
Is there a way in SQL to see how much storage is required? We run all of our nightly backups offsite to DR, I am stopping thee backups the few days I am migrating as I would only need a local backup shoudl something not migrate over.

I am needing to know how much disk space I require for a FULL backup  so I may request a dedicated shared location to backup to.

Thank you

Who is Participating?
Vitor MontalvãoConnect With a Mentor MSSQL Senior EngineerCommented:
If your full database backup runs every week then you can know how much space was used in the last backup by running the following query:
USE msdb

SELECT SUM(backup_size/1024/1024) TotalBakSizeMB, SUM(compressed_backup_size/1024/1024) CompressedTotalBakSizeMB
FROM backupset
WHERE type='D'
 AND backup_finish_date=(SELECT MAX(backup_finish_date) 
						FROM backupset bak2
						WHERE bak2.database_name = backupset.database_name AND bak2.type='D')

Open in new window

I added the Compressed Backup Size since I don't know if you are using compressed backups or not. Anyway, if you don't the values should be the same. The results are in MB but you can divide by 1024 to get it in GB.
Vitor MontalvãoMSSQL Senior EngineerCommented:
All databases are in the same instance?
What is the frequency of the Full Backups?
Carl TawnSystems and Integration DeveloperCommented:
Assuming you're not using compression then a full backup of a database will be the same size as the size of the allocated extents within the datafiles for each database.

You can use sp_spaceused to view details of the size being used.
manelson05Author Commented:
All databases are in the same instance, anyway to select all databases.
Databases are uncompressed, we back up every eight hours.
Scott PletcherSenior DBACommented:
You do a full backup every 8 hours for 491 databases?  Hmm, I'd re-think that strategy.  At the very least you could mix in some differential backups.

>> then a full backup of a database will be the same size as the size of the allocated extents within the datafiles for each database <<

That is not true.  The backup will be smaller since it will not contain control info nor free space from the SQL blocks.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.