Next: Database Backups Up: The SNO Database: SNODB Previous: Adding a New

Database Verification

It is important that the integrity of the data in the database be frequently checked. With SNODB, this can be done automatically whenever a bank is retrieved. At each local site, a (yet to be written) utility will regularly check each bank in the database for corruption. User applications can also verify each bank as it is retrieved, to ensure that corrupted data is not used.

Verification is disabled by default in the SDB code. To enable it in SNOMAN, set the appropriate word to ``1'' in the TSDB bank in the job_control.dat file, or use the $sdb_enable_verification mnemonic in a command file. To enable it in non-SNOMAN code, the following call must be made prior to retrieving the bank:

The data is verified using the following procedure. Before each Zebra bank is stored in the database, a checksum of its contents is computed and written to the database header within the bank. Each word in the bank is converted to CERN's exchange format when computing the checksum to ensure that the results are independent of the computer platform used to store the bank. When the data is read back using the SDB_READ routine, if data verification is enabled, then the checksum is re-computed and compared to the one stored in the header. A difference in the two checksums indicates that the data has been corrupted. In such a case, a message is printed and the bank is not returned to the user for use. The user should promptly notify the local database administrator and the SNO database czar so that the database can be repaired as quickly as possible.

The platform-independent checksum computation uses the Zebra bank I/O descriptor to determine the word type prior to converting it to exchange format. A similar operation takes place when the data is stored in exchange format so that it can be correctly distributed among the various supported computer platforms (with their various native data formats and byte-orderings). Those people that are responsible for inputting data to the database (calibrators, for example) must ensure that the I/O descriptor is correct, or the checksum will be incorrect and the data may be corrupted when transferred to other platforms.



Next: Database Backups Up: The SNO Database: SNODB Previous: Adding a New


cdsno@higgs.hep.upenn.edu
Mon Aug 10 17:56:28 EDT 1998