oncheck -cd and oncheck -cD commands: Check pages

Use the oncheck -cd and oncheck -cD commands to check each page for consistency. Use the oncheck -cd -y or oncheck -cD -y command to repair inconsistencies.

Figure 1. Syntax:

1  oncheck
1 
2.1  -cd
2.1  -cD
1?   -y
1 database
1?  :? owner. table
2.1 ,frag_dbs
2.1 %frag_part

The oncheck -cd command reads all pages, except for blobpages and sbpages, from the tblspace for the specified database, table, fragment, or multiple fragments (fragparts), and checks each page for consistency. This command compares entries in the bitmap page to the pages to verify mapping.

The oncheck -cD command performs the same checks as the oncheck -cd command, and also checks the header of each blobpage for consistency. The oncheck -cD command does not compare the beginning time stamps stored in the header with the ending time stamps stored at the end of a blobpage. Use the oncheck -cD -y command to clean up orphaned simple large objects in blobspaces, which can occur after a rollback across several log files.

If the database contains fragmented tables, but no fragment is specified, the oncheck -cd command checks all fragments in the table. If you do not specify a table, the command checks all of the tables in the database. By comparison, the oncheck -pd command displays a hexadecimal dump of specified pages but does not check for consistency.

For both the oncheck -cd and oncheck -cD commands, the oncheck utility locks each table as it checks the indexes for the table. To repair the pages, use oncheck -cd -y or oncheck -cD -y.

If tables are fragmented on multiple partitions in the same dbspace, the oncheck -cd and oncheck -cD commands show the partition names. The following example shows typical output for a table that has fragments in multiple partitions in the same dbspace:
TBLspace data check for multipart:informix.t1
              Table fragment partition part_1 in DBspace dbs1
              Table fragment partition part_2 in DBspace dbs1
              Table fragment partition part_3 in DBspace dbs1
              Table fragment partition part_4 in DBspace dbs1
              Table fragment partition part_5 in DBspace dbs1
When you use the oncheck -cd or oncheck -cD command, you can specify either the frag_dbs or the %frag_dbs option but not both:
  • When you use the frag_dbs option, the utility checks all fragments in the dbspace frag_dbs.
  • When you use the %frag_dbs option, the utility checks only the fragment named frag_part, if the PARTITION syntax was used when the fragment or table was created.

While it is possible to fragment an index with the PARTITION syntax, it is not possible to limit an index check to just one fragment or partition. For example, you can specify oncheck -cDI my_db:my_tab,data_dbs1 or oncheck -cDI my_db:my_tab%part1. The D (data) portion of the check is limited according to the specification, however the I (index) check is not limited.

Examples

The following example checks the data rows, including simple large objects and smart large objects, in the catalog table:
oncheck -cD superstores_demo:catalog
If you specify a single fragment, the oncheck utility displays a single header for that fragment. For fragmented tables, one header is displayed for each fragment:
TBLspace data check for stores_demo:informix.tab1
 Table fragment in DBspace db1

Messages

If the oncheck utility finds no inconsistencies, a header displays for each table that the utility. For example:
TBLSPACE data check for stores_demo:informix.customer
If the oncheck utility finds an inconsistency, a message displays. For example:
BAD PAGE 2:28: pg_addr 2:28 != bp-> bf_pagenum 2:69

The physical address 2:28 represents page 28 of chunk number 2.

If an index that uses an access method provided by a DataBlade® module cannot find the access method, you receive the following message:
-9845 Access method access_method_name does not exist in database. 
Ensure that the DataBlade installation was successful.

Reference

To monitor blobspace blobpages, see oncheck -pB: Display blobspace statistics.