Welcome To DBA Share

Check SQL database backup size and history

0 comments

As a Database Administrator we need to take a checklist of all production servers. Apart from this we have to monitor backup file size of sql database.

Today I would like to share one script which helps to show database name, type, size of the backup file, recovery model, when the backup was started and when it finished also you will get where the backup file is reside in the server

SELECT
 bs.database_name,
 bs.type,
 (bs.compressed_backup_size/1024)/1024 [BackupSize (MB)],
 bs.recovery_model,  
 bf.physical_device_name,
 bs.user_name,
 bs.backup_start_date,
 bs.backup_finish_date
FROM
 msdb..backupset bs
INNER JOIN msdb..backupmediafamily bf
 ON bf.media_set_id=bs.media_set_id
 where type ='d' and backup_start_date between '2013-05-22' and '2013-05-23'
----------

Note:  consider the below key points.

Include  'D' for getting 'Full backup'        
Include  'I' for getting 'Differential backup'          
Include  'L' for getting 'Log backup'

Source  Also check
Share this article :

Post a Comment

 
Support : 2005 | 2008 | 2008R2 | 2012 | 2014 | SQL Server DBA
Copyright © 2013. DBA Share - All Rights Reserved
Template Created by Creating Website Modify by CaraGampang.Com
Proudly powered by Blogger