To optimize the number of accesses to the database, BCHECK checks the database in a single sweep.
BCHECK initially makes local checks in the specified realms on:
the Act-Key-0 page and Act-Key-N page,
FPA pages, DBTT anchor pages and DBTT pages,
the page header of all database pages,
the formal structure of CALC and table pages including lists of level 0,
the agreement of the key values in the records with those of the CALC table line in direct CALC pages,
the record displacements in the page index entries, and
the sort sequence of the keys or the record sequence numbers in the table pages
i.e. it checks the internal page structures of the realms.
Subsequently BCHECK checks the global relationships of the specified check objects, i.e. those relationships which transcend page structures. To do this it reads the relevant DBTT entries, SCD entries, table headers, table entries and records from the record types, sets and search keys to be checked and generates what are known as the check records from this information.