SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Check Backups


Check Backups

Author
Message
SQLSACT
SQLSACT
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14973 Visits: 3106
Comments posted to this topic are about the item Check Backups
Feivel
Feivel
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3723 Visits: 1802
Hi,

I would really appreciate if you could write a code which will get results from all the servers through linked servers, and could mail the DBA's with a really nice html formatted report.

Regards,
Faisal
The Wizard Of Oz
The Wizard Of Oz
Say Hey Kid
Say Hey Kid (665 reputation)Say Hey Kid (665 reputation)Say Hey Kid (665 reputation)Say Hey Kid (665 reputation)Say Hey Kid (665 reputation)Say Hey Kid (665 reputation)Say Hey Kid (665 reputation)Say Hey Kid (665 reputation)

Group: General Forum Members
Points: 665 Visits: 314
A set-based, non-loopy way of doing a similar thing:


SELECT
DB_NAME(d.database_id)'DB',
ISNULL
('Backed up '+CAST(DATEDIFF(day,b.backup_start_date,GETDATE()) as varchar(10))+' days ago.',
'Never been backed up!'
)'Backup Info'
FROM sys.databases d
LEFT JOIN
(SELECT database_name,MAX(backup_start_date)'backup_start_date'
FROM msdb.dbo.backupset
GROUP BY database_name
)b ON b.database_name=DB_NAME(d.database_id)
WHERE DB_NAME(d.database_id)<>'tempdb'
ORDER BY 2 DESC, 1


DLathrop
DLathrop
UDP Broadcaster
UDP Broadcaster (1.4K reputation)UDP Broadcaster (1.4K reputation)UDP Broadcaster (1.4K reputation)UDP Broadcaster (1.4K reputation)UDP Broadcaster (1.4K reputation)UDP Broadcaster (1.4K reputation)UDP Broadcaster (1.4K reputation)UDP Broadcaster (1.4K reputation)

Group: General Forum Members
Points: 1436 Visits: 219
It's a good idea to check that the server_name column of msdb.dbo.backupset matches the server you are checking.

When you do a restore, if the backup set being restored isn't already in msdb.dbo.backupset, an entry will be created for it. This will be constructed based on the backup file's header and will have the name of the server and database that was actually backed up and the backup date. There will be a restorehistory record that references this backupset record, and will reflect the database that was restored to (possibly with a different name) and the restore date.

There are also some GUIDs and LSNs in a table called master.sys.database_recovery_status which can be compared with msdb.dbo.backupset to check if a backup set actually corresponds with the current database with the same name. Look in BOL under "Recovery Forks" for an explanation of what these mean.

If you do a restore, you typically should do a full backup right away. However, without some of this additional checking in msdb.dbo.backupset queries, it's easy to mistake the restore for a backup.

David Lathrop
DBA
WA Dept of Health
Iwas Bornready
Iwas Bornready
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45650 Visits: 886
Thank you for your script.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search