Saturday, 16 February 2013

Find which db have not been backuped

This is a script I run periodically to identify databases with no backup.
I’ve been running this just in case a database is created out of left field or maybe was omitted from a backup job.




use msdb
go
select distinct
d.name
from sys.databases d
left join backupset bs
on bs.database_name = d.name
where bs.database_name is null
and d.name <> 'tempdb'
order by d.name

No comments:

Post a Comment