Skip to content

Add Checksum Flag for Test-DbaLastBackupΒ #9735

@leepfrog-ger

Description

@leepfrog-ger

Summarize Functionality

Add a -Checksum parameter to Test-DbaLastBackup which controls whether to include WITH CHECKSUM to the issued RESTORE VERIFYONLY command.

Is there a command that is similiar or close to what you are looking for?

No

Technical Details

Currently Test-DbaLastBackup does not offer any option to control whether the RESTORE VERIFYONLY command uses WITH CHECKSUM or NO_CHECKSUM.
As this parameter is omitted for the RESTORE VERIFYONLY command the default is applied, which means that backup checksums will be validated if they exist:

The default behavior is to verify checksums if they are present and proceed without verification if they are not present.

Source: https://learn.microsoft.com/en-us/sql/t-sql/statements/restore-statements-arguments-transact-sql?view=sql-server-ver16#-checksum--no_checksum-

Following best practices backups should always contain checksums, and therefore having the option to be alerted in case no checksum is present would be a nice.

That would be done by using RESTORE VERIFYONLY ... WITH CHECKSUM and result in this behavior:

Specifies that backup checksums must be verified and, if the backup lacks backup checksums, causes the restore operation to fail with a message indicating that checksums are not present.

Further information regarding the backup checksum mechanisms in SQL server: https://learn.microsoft.com/en-us/sql/relational-databases/backup-restore/possible-media-errors-during-backup-and-restore-sql-server?view=sql-server-ver16

Metadata

Metadata

Assignees

No one assigned

    Labels

    featuretriage requiredNew issue that has not been reviewed by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions