Home | Previous Page | Next Page   Utility Reference > onutil: Check, Define, and Modify Storage Objects >

CHECK INDEX KEYS WITH DATA

The onutil CHECK INDEX WITH DATA command checks the ordering of key values and the consistency of horizontal and vertical node links for B-tree indexes and bitmaps that are associated with the specified table. This command also checks that the key value tied to a rowid in an index is the same as the key value in the row.

Syntax

Read syntax diagramSkip visual syntax diagram>>-CHECK INDEX WITH DATA--+-| INDEX |-------------+--+------+--->
                          +-IN DATABASE--database-+  '-LOCK-'
                          '-| TABLE |-------------'

>--+------------------------+----------------------------------><
   +-DISPLAY----------------+
   '-SAVE--+--------------+-'
           '-IN--filename-'

Read syntax diagramSkip visual syntax diagramTABLE:

|--IN TABLE--database--:--+----------+--table_name--------------|
                          '-owner--.-'

Read syntax diagramSkip visual syntax diagramINDEX:

|--database--#--+----------+--index_name------------------------|
                '-owner--.-'

Element Purpose Restrictions Syntax
database The name of the database where the index resides The database must exist.
You cannot check databases on remote database servers.
See Database Name in the IBM Informix: Guide to SQL Syntax.
filename The name of the file in which onutil stores the command output If you run the onutil command from the command line, escape the double quotes around the filename. Use the operating-system rules for the filename.
database The name of the database where the table resides The database must exist.
You cannot check databases on remote database servers.
See Database Name in the IBM Informix: Guide to SQL Syntax.
owner The name of the owner of a table Owner that you specify must be current owner of table. Owner is mandatory for ANSI databases. The user name must conform to the conventions of your operating system.
table_name The name of the table that you want to check Table must exist. See Identifiers in onutil Commands.
index_name The name of the index that you want to check The index must exist. See Object Name in the IBM Informix: Guide to SQL Syntax.

Usage

Use the onutil CHECK INDEX WITH DATA command to check the internal integrity of a B-tree index and cross-check the indexed data entities.

The LOCK option locks the table in share mode, so no other users can insert, update, or delete rows in the table while the check occurs.

For example, you can use the following onutil command to check the B-tree index of a table:

% onutil
1> CHECK INDEX WITH DATA IN DATABASE mydb;
2> CHECK INDEX WITH DATA IN TABLE mydb:myname.mytable;
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]