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

CHECK INDEX

The onutil CHECK INDEX 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. With the DISPLAY clause, onutil CHECK INDEX also displays the key values for the B-tree indexes and bitmaps of the specified table as it checks them.

Syntax

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

>--+------------------------+----------------------------------><
   +-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.
partnum The table or index partition number that you want to check for consistency Value must be an integer between 0 and 208,666,624, inclusive. Unsigned integer.
filename The relative or absolute path and 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 or 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.
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 Index Name.

Usage

Use the onutil CHECK INDEX command to check the integrity of a B-tree index and display the contents of all nodes.

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 check the index of a table with these onutil commands:

% onutil
1> CHECK INDEX IN DATABASE mydb;
2> CHECK INDEX IN TABLE mydb:myname.mytable;
3> CHECK INDEX IN TABLESPACE 11111 DISPLAY;

Another way to check the index of a table follows:

1> CHECK INDEX mydb#myname.myindex
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]