bcheck -[ i | l | y | n | q | s ] filename

where filename does not have suffix .idx or .dat.

Options

-i             Check index file only
-l
             List entries in B+ trees
-n
            Answer no to all questions
-y
             Answer yes to all questions
-q
             Suppress printing of the program banner
-s
             Resize the index file node size

Unless you use the -n or -y option, bcheck is interactive, waiting for you to respond to each error it finds.

Use the -y option with caution.  Do not run bcheck using the -y option if you are checking the files for the first time.

For each index, bcheck prints up to eight groups of three numbers.  These numbers indicate the starting position, length, and type of each part of each key.

When running bcheck -s, the index created on a Unix platform will have an uppercase extension.  This will cause subsequent BCHECKs of the file to display the message ‘Error linking .IDX to .idx’.  To avoid this situation, delete the file name with the lowercase extension, and rename the remaining file, changing only the case of the file extension.

If BCHECK is used with a wild card and either an .idx or .dat file referenced by the wild card is missing, all subsequent files checked will display the message “ERROR: Bad data record?.

Example 1

In the following example, bcheck checks all indexes for custome100 and finds no errors.

bcheck CUSTOME100

BCHECK C-ISAM B-tree Checker VERSION 40.00
Copyright (C) 1981-1989 Informix Software, Inc.
Software Serial Number INF#R000000

C-ISAM File:  custome100

Checking dictionary and file sizes.
Index file node size = 1024
Current C-ISAM index file node size = 1024
Checking data file records.
Checking indexes and key descriptions.
Index 1 = unique key
0 index node(s) used -- 1 index b-tree level(s) used
Index 2 = unique key (0,4,2)
1 index node(s) used -- 1 index b-tree level(s) used
Index 3 - duplicates (111,5,0)
1 index node(s) used -- 1 index b-tree level(s) used
Checking data record and index node free lists.
4 index node(s) used, 0 free -- 18 data record(s) used, 4 free

Example 2

The following sample runs where bcheck finds errors.  The -n option is selected so that each question that bcheck asks is automatically answered "no".

bcheck -n CUSTOME100

BCHECK C-ISAM B-tree Checker VERSION 40.00
Copyright (C) 1981-1989 Informix Software, Inc.
Software Serial Number INF#R000000

C-ISAM File:  custome100

Checking dictionary and file sizes.
Index file node size = 1024
Current C-ISAM index file node size = 1024
Checking data file records.
Checking indexes and key descriptions.
Index 1 = unique key
0 index node(s) used -- 1 index b-tree level(s) used

ERROR:  3 bad data record(s)
Delete index ? no

Index 2 = unique key (0,4,2)
1 index node(s) used -- 1 index b-tree level(s) used

ERROR:  3 bad data record(s)
Delete index ? no

Index 3 - duplicates (111,5,0)
1 index node(s) used -- 1 index b-tree level(s) used

ERROR:  3 bad record(s)
Delete index ? no

Checking data record and index node free lists.

ERROR:  3 missing data record(s)
Fix data record free list ? no

4 index node(s) used, 0 free -- 18 data record(s) used, 4 free

Since bcheck finds errors, you must delete and rebuild the corrupted indexes. 

Example 3

The -y option is used to answer "yes" to all questions asked by bcheck:

bcheck -y CUSTOME100

BCHECK C-ISAM B-tree Checker VERSION 40.00
Copyright (C) 1981-1989 Informix Software, Inc.
Software Serial Number INF#R000000

C-ISAM File:  custome100

Checking dictionary and file sizes.
Checking data file records.
Checking indexes and key descriptions.
Index 1 = unique key
1 index node(s) used -- 1 index b-tree level(s) used

ERROR:  3 bad data record(s)
Delete index ? yes

Remake index ? yes

Index 2 = unique key (0,4,2)
1 index node(s) used -- 1 index b-tree level(s) used

ERROR:  3 bad data record(s)
Delete index ? yes

Remake index ? yes

Index 3 - duplicates (111,5,0)
1 index node(s) used -- 1 index b-tree level(s) used
ERROR:  3 bad record(s)
Delete index ? yes

Remake index ? yes

Checking data record and index node free lists.

ERROR:  3 missing data record(s)
Fix data record free list ? yes

Recreate data record free list
Recreate index 3
Recreate index 2
Recreate index 1

4 index node(s) used, 0 free -- 18 data record(s) used, 4 free

Comment on this topic

Topic ID: 720238

 
 
 

Table of Contents

Index

Glossary

-Search-

Back