Wait for some time and Let the Mirroring repair the corrupted page in Principal Database
6. Let me access the corrupted Table again in Principal Database
:CONNECT PANDIAN\SQL2012
SELECT %%LockRes%% [Page Allocation],* FROM PrimaryDB1.dbo.TABLE1
It's done!!! - The corrupted page got repaired and The table back to operational
Let's make sure
:CONNECT PANDIAN\SQL2012
See, The event_type column has 5 now (Repaired)
:CONNECT PANDIAN\SQL2012
See, The page_status column has 5 (5 = Automatic page repair succeeded and the page should be usable)
What just happening when the page corrupted at Principal source ?
According to MSDN
a) When a read error occurs on a data page in the principal/primary database, the principal/primary inserts a row in the suspect_pages table with the appropriate error status. the principal then requests a copy of the page from the mirror.
b) The request specifies the page ID and the LSN that is currently at the end of the flushed log.
c) The page is marked as restore pending. This makes it inaccessible during the automatic page-repair attempt. Attempts to access this page during the repair attempt will fail with error 829 (restore pending)
d) After receiving the page request, the mirror/secondary waits until it has redone the log up to the LSN specified in the request. Then, the mirror/secondary tries to access the page in its copy of the database. If the page can be accessed, the mirror/secondary sends the copy of the page to the principal/primary. Otherwise, the mirror/secondary returns an error to the principal/primary, and the automatic page-repair attempt fails.
7. What will happen, If the Principal and Mirror versions are different ?