Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions sp_BlitzBackups.sql
Original file line number Diff line number Diff line change
Expand Up @@ -975,18 +975,18 @@ RAISERROR('Rules analysis starting', 0, 1) WITH NOWAIT;
100 AS [Priority],
b.database_name AS [Database Name],
''No CHECKSUMS'' AS [Finding],
''The database '' + QUOTENAME(b.database_name) + '' has been backed up '' + CONVERT(VARCHAR(10), COUNT(*)) + '' times without CHECKSUMS in the past 30 days. CHECKSUMS can help alert you to corruption errors.'' AS [Warning]
''The database '' + QUOTENAME(b.database_name) + '' has been backed up '' + CONVERT(VARCHAR(10), COUNT(*)) + '' times without CHECKSUMS. CHECKSUMS can help alert you to corruption errors.'' AS [Warning]
Comment thread
BrentOzar marked this conversation as resolved.
FROM ' + QUOTENAME(@MSDBName) + N'.dbo.backupset AS b
WHERE b.has_backup_checksums = 0
AND b.backup_finish_date >= DATEADD(DAY, -30, SYSDATETIME())
AND b.backup_finish_date >= @StartTime
GROUP BY b.database_name;' + @crlf;

IF @Debug = 1
PRINT @StringToExecute;

INSERT #Warnings ( CheckId, Priority, DatabaseName, Finding, Warning )
EXEC sys.sp_executesql @StringToExecute;
EXEC sys.sp_executesql @StringToExecute, N'@StartTime DATETIME2', @StartTime;

/*Damaged is a Black Flag album. You don''t want your backups to be like a Black Flag album. */

SET @StringToExecute = N'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;' + @crlf;
Expand Down Expand Up @@ -1089,17 +1089,17 @@ IF @ProductVersionMajor >= 12
100 AS [Priority],
b.database_name AS [Database Name],
''Uncompressed backups'' AS [Finding],
''The database '' + QUOTENAME(b.database_name) + '' has had '' + CONVERT(VARCHAR(10), COUNT(*)) + '' uncompressed backups in the last 30 days. This is a free way to save time and space. And SPACETIME. If your version of SQL supports it.'' AS [Warning]
''The database '' + QUOTENAME(b.database_name) + '' has had '' + CONVERT(VARCHAR(10), COUNT(*)) + '' uncompressed backups. This is a free way to save time and space. And SPACETIME. If your version of SQL supports it.'' AS [Warning]
Comment thread
BrentOzar marked this conversation as resolved.
FROM ' + QUOTENAME(@MSDBName) + '.dbo.backupset AS b
WHERE backup_size = compressed_backup_size AND type = ''D''
AND b.backup_finish_date >= DATEADD(DAY, -30, SYSDATETIME())
AND b.backup_finish_date >= @StartTime
GROUP BY b.database_name;' + @crlf;

IF @Debug = 1
PRINT @StringToExecute;

INSERT #Warnings ( CheckId, Priority, DatabaseName, Finding, Warning )
EXEC sys.sp_executesql @StringToExecute;
EXEC sys.sp_executesql @StringToExecute, N'@StartTime DATETIME2', @StartTime;

/*Looking for backups directed at the NUL device.*/
SET @StringToExecute =N'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;' + @crlf;
Expand Down