From the course: Complete Guide to Advanced SQL Server

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Recover a compromised database

Recover a compromised database

After discovering an inconsistency between your database's ledger and the digests, your immediate question is probably, okay, now what do we do? Here's some tips for how to recover your database back to a healthy and tamper-free state. First, you'll probably want to do a deeper dive to understand the scale of the issue. Was it just a single record that was affected? If so, you might be able to update the value manually back to the value that it should be. If the issue is more widespread, comparing the compromised database against a known good backup copy may help you further determine what rows were tampered with. There are two new catalog views that you can make use of in your investigation. sys.database_ledger_blocks returns a list of all of the closed blocks on your ledger blockchain. The block size corresponds to the number of transactions recorded in the block, and the hash of the previous block is also displayed. You can compare these hashes to your digests to help determine…

Contents