MCITP

MCITP

Tuesday, September 11, 2012

Script to find the list of database name whose backup is not happened for the past one day


Run the below command and it will list out all the database name that have not been backed up since yesterday.

use msdb;
SELECT  backupset.database_name,backupset.backup_start_date,backupmediafamily.physical_device_name,(backupset.backup_size/1024)/1000 as size
FROM   backupset,backupmediafamily where backupset.media_set_id = backupmediafamily.media_set_id
and datediff(dd,backupset.backup_start_date,getdate()) < 1 and database_name like '%%' order by backupset.database_name,backupset.backup_start_date desc

No comments:

Post a Comment

Followers