Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Get total file size of backup for last full backup

By James Travis,

The information for backup size is stored in the backup_size column of the backupset table in the msdb database as the total bytes for that backup.
This script allow you to look at the total back to tape or file so you can plan space needs for those devices.
This is a simple piece of code so you may need to adjust for your specific needs, but the basic outline of it should help you in looking at your backups in whatever situation you need.
Also files have a header and maybe footer so there are some extra bytes added beyond what is stored in the database for this information which is 1536 and has been calculated in.

Some Options you should be aware of when using this code.

backupmediafamily device_type
2 = File
5 = Tape

backupset type
L = Log
I = Differential
D = Full

(Note: May be other options but these are the ones I find on my system and can identify.)

Total article views: 2436 | Views in the last 30 days: 2
 
Related Articles
FORUM

backup

backup

FORUM

backup

backup

FORUM

backup

backup

FORUM

Backup

Backup

FORUM

backup

backup

 
Contribute