Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Backup compression report

Author  Topic 

Haywood
Posting Yak Master

221 Posts

Posted - 2008-03-19 : 14:21:06
I've been working on porting my backup routines to 2008 and fooling around with the COMPRESSION option for both database & log(!) backups.

This report shows the storage savings when using COMPRESSION as a backup option.

[CODE]
USE msdb
GO

SELECT database_name
, description
, type
, CONVERT(varchar(26),backup_start_date) AS [Backup Start Time]
, CONVERT(varchar(26),backup_finish_date) AS [Backup Finish Time]
, RTRIM(CONVERT(varchar(55),CONVERT(DECIMAL(4,1),(backup_size/compressed_backup_size))) + ' :1') AS [Compression Ratio]
, CONVERT(DECIMAL(9,2),(backup_size * .000001024)) AS [Un-Compressed Backup Size MB]
, CONVERT(DECIMAL(9,2),(compressed_backup_size * .000001024)) AS [Compressed Size MB]

FROM msdb.dbo.backupset

WHERE (backup_size/compressed_backup_size) > 1

ORDER BY [Backup Finish Time] DESC
, [Compression Ratio]
GO
[/CODE]
   

- Advertisement -