patternsqlModerate
What is the SQL server mechanism to ensure that the page being restored isn't corrupted?
Viewed 0 times
corruptedthewhatsqlensurebeingmechanismthatpageserver
Problem
Assuming dbcc checkdb shows corruption on 1 page.
Suppose I want to fix this by restoring the corrupted page only.
So I go to the Restore page UI, click the button to find the corrupted page, enter the full and log backup files and restore.
My question is - what is the way that sql sever checks whether the page is corrupt or not in the given full backup?
Suppose I want to fix this by restoring the corrupted page only.
So I go to the Restore page UI, click the button to find the corrupted page, enter the full and log backup files and restore.
My question is - what is the way that sql sever checks whether the page is corrupt or not in the given full backup?
Solution
It wont. If you have a corrupted page in a backup file and you restore it, SQL will restore it (and it won't raise any error).
It's your job to run checkdb frequently and make sure you do not backup corrupted pages.
For now, you could try restoring your latest full backup + diff/log and run a checkdb to see if this fixed your corruption.
If it did not, then you can get the previous full backup and apply all log up to the last (which may take time as you may have a lot of them to restore) and run a checkdb again.
*You could save time by restoring only the full somewhere else and run the checkdb there. If the page is not corrupted in the full, it should technically remain uncorrupted after applying the logs.
It's your job to run checkdb frequently and make sure you do not backup corrupted pages.
For now, you could try restoring your latest full backup + diff/log and run a checkdb to see if this fixed your corruption.
If it did not, then you can get the previous full backup and apply all log up to the last (which may take time as you may have a lot of them to restore) and run a checkdb again.
*You could save time by restoring only the full somewhere else and run the checkdb there. If the page is not corrupted in the full, it should technically remain uncorrupted after applying the logs.
Context
StackExchange Database Administrators Q#316602, answer score: 10
Revisions (0)
No revisions yet.