Techniques are provided for detecting lost writes so that data corruption
can be avoided. According to one technique, lost writes are detected by
comparing version numbers that are indicated in redo log entries with
version numbers that are indicated in corresponding blocks in a standby
database. According to one technique, which may be used in conjunction
with the above technique, lost writes are detected by logging read
operations that occur relative to a primary database, and comparing
version numbers that are indicated in read log entries with version
numbers that are indicated in corresponding blocks in a standby database.
According to one technique, lost writes are detected by comparing, in
response to read operations, (a) version numbers that are stored in a
persistent in-memory cache with (b) version numbers that are indicated in
corresponding blocks that are read from a primary database.