Comparison of INSPECT and db2dart

The INSPECT command inspects a database for architectural integrity, checking the pages of the database for page consistency. The INSPECT command checks that the structures of table objects and structures of table spaces are valid. Cross object validation conducts an online index to data consistency check. The db2dart command examines databases for architectural correctness and reports any encountered errors.

The INSPECT command is similar to the db2dart command in that it allows you to check databases, table spaces, and tables. A significant difference between the two commands is that the database needs to be deactivated before you run db2dart, whereas INSPECT requires a database connection and can be run while there are simultaneous active connections to the database.

If you do not deactivate the database, db2dart will yield unreliable results.

The following tables list the differences between the tests that are performed by the db2dart and INSPECT commands.

Table 1. Feature comparison of db2dart and INSPECT for table spaces
Tests performed db2dart INSPECT
SMS table spaces
Check table space files YES NO
Validate contents of internal page header fields YES YES
DMS table spaces
Check for extent maps pointed at by more than one object YES NO
Check every extent map page for consistency bit errors NO YES
Check every space map page for consistency bit errors NO YES
Validate contents of internal page header fields YES YES
Verify that extent maps agree with table space maps YES NO
Table 2. Feature comparison of db2dart and INSPECT for data objects
Tests performed db2dart INSPECT
Check data objects for consistency bit errors YES YES
Check the contents of special control rows YES NO
Check the length and position of variable length columns YES NO
Check the LONG VARCHAR, LONG VARGRAPHIC, and large object (LOB) descriptors in table rows YES NO
Check the summary total pages, used pages and free space percentage NO YES
Validate contents of internal page header fields YES YES
Verify each row record type and its length YES YES
Verify that rows are not overlapping YES YES
Table 3. Feature comparison of db2dart and INSPECT for index objects
Tests performed db2dart INSPECT
Check for consistency bit errors YES YES
Check the location and length of the index key and whether there is overlapping YES YES
Check the ordering of keys in the index YES NO
Determine the summary total pages and used pages NO YES
Validate contents of internal page header fields YES YES
Verify the uniqueness of unique keys YES NO
Check for the existence of the data row for a given index entry NO YES
Verify each key to a data value NO YES
Verify the hash value for key parts with RANDOM ordering YES YES (when the INDEXDATA option of INSPECT is used)
Table 4. Feature comparison of db2dart and INSPECT for block map objects
Tests performed db2dart INSPECT
Check for consistency bit errors YES YES
Determine the summary total pages and used pages NO YES
Validate contents of internal page header fields YES YES
Table 5. Feature comparison of db2dart and INSPECT for long field and LOB objects
Tests performed db2dart INSPECT
Check the allocation structures YES YES
Determine the summary total pages and used pages (for LOB objects only) NO YES
In addition, the following actions can be performed using the db2dart command:
  • Format and dump data pages
  • Format and dump index pages
  • Format data rows to delimited ASCII
  • Mark an index invalid
The INSPECT command cannot be used to perform those actions.