![]() ![]() ![]() On a daily basis that highlights any missed backups. Using this final query I produce a report that is distributed to the DBA Team I've set that value at 9999 hours because in my environment I want to placeĪ higher emphasis on those databases that have never been backed up. The arbitrary value I've assigned to the aging value for databases without any backup It is recreated each time the SQL Server services are restarted. Tempdb out from the result set since you do not back up that systemĭatabase. That second statement returns information on allĭatabases that have no backup history. This data is then combined via the UNION statement to the second Last database (full) backup is older than 24 hours from the current systemĭate. Caveat #1 - the first part of the query returns all records where the.Now let me explain those caveats, and this query. MAX(_finish_date) AS last_db_backup_date,ĭATEDIFF(hh, MAX(_finish_date), GETDATE()) AS Databases with data backup over 24 hours old Databases Missing a Data (aka Full) Back-Up Within Past 24 Hours Most Recent Database Backup for Each Database - Detailed Note: for readability the output was split into two screenshots. (CONVERT(datetime, _start_date, 102) >= GETDATE() - 7) Database Backups for all databases For Previous WeekĬONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS Server, ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |