Subject Re: [IB-Architect] Next ODS change (was: System table change)
Author jansdal@it.dk
Ann,

Instead of calculating page checksums, I will suggest
that you implement a very fast "torn page detection"
algorithm.

The SQL Server 7 has this optional torn page detection feature:


<QUOTE book="Inside SQL Server 7.0" pages="207-208">
torn page detection. When TRUE, this option causes a bit to
be flipped for each 512-byte sector in a database page (8 KB)
whenever the page is written to disk. This option allows SQL
Server to detect incomplete I/O operations caused by power
failures or other system outages. If a bit is in the wrong
state when the page is later read by SQL Server, this means
the page was written incorrectly; a torn page has been
detected. Although SQL Server database pages are 8 KB,
disks perform I/O operations using 512-byte sectors.
Therefore, 16 sectors are written per database page. A torn
page can occur if the system crashes (for example, because
of power failure) between the time the operating system
writes the first 512-byte sector to disk and the completion
of the 8-KB I/O operation. If the first sector of a database
page is successfully written before the crash, it will appear
that the database page on disk was updated, although it might
not have succeeded. Using battery-backed disk caches can
ensure that data is successfully written to disk or not
written at all. In this case, don't set torn page detection
to TRUE, as it isn't needed. If a torn page is detected, the
database will need to be restored from backup because it will
be physically inconsistent.
</QUOTE>


Best regard

Steen Jansdal