isamchk
isamchk is invoked like this:@:
shell> isamchk [options] nom_table
The options specify what you want isamchk to do. They are
described below. (You can also get a list of options by invoking
isamchk --help.) With no options, isamchk simply checks your
table. To get more information or to tell isamchk to take corrective
action, specify options as described below and in the following sections.
nom_table is the database table you want to check. If you run
isamchk somewhere other than in the database directory, you must
specify the path to the file, since isamchk has no idea where your
database is located. Actually, isamchk doesn't care whether or not
the files you are working on are located in a database directory; you can
copy the files that correspond to a database table into another location and
perform recovery operations on them there.
You can name several tables on the isamchk command line if you
wish. You can also specify a name as an index file
name (with the `.ISM' suffix), which allows you to specify all
tables in a directory by using the pattern `*.ISM'.
For example, if you are in a database directory, you can check all the
tables in the directory like this:@:
shell> isamchk *.ISM
If you are not in the database directory, you can check all the tables there by specifying the path to the directory:@:
shell> isamchk /path/to/database_dir/*.ISM
You can even check all tables in all databases by specifying a wildcard with the path to the MySQL data directory:@:
shell> isamchk /path/to/datadir/*/*.ISM
isamchk supports the following options:@:
-a, --analyze
-#, --debug=debug_options
debug_options string often is
'd:@:t:o,filename'.
-d, --description
-e, --extend-check
isamchk should find all errors even without this option.
-f, --force
-f when checking tables (running isamchk
without -r), isamchk will automatically restart with -r
on any table for which an error occurs during checking.
--help
-i, --information
-k #, --keys-used=#
-r. Tell the NISAM table handler to update only the first
# indexes. Higher-numbered indexes are deactivated. This can be used
to get faster inserts! Deactivated indexes can be reactivated by using
isamchk -r.
-l, --no-symlinks
isamchk repairs the table a symlink points at.
-q, --quick
-r to get a faster repair. Normally, the original data file
isn't touched; you can specify a second -q to force
the original data file to be used.
-r, --recover
-o, --safe-recover
-r, but can
handle a couple of cases that -r cannot handle.
-O var=option, --set-variable var=option
-s, --silent
-s twice (-ss) to make isamchk
very silent.
-S, --sort-index
-R index_num, --sort-records=index_num
SELECT and ORDER BY operations on
this index. (It may be VERY slow to do a sort the first time!)
To find out a table's index numbers, use SHOW INDEX, which shows a
table's indexes in the same order that isamchk sees them. Indexes are
numbered beginning with 1.
-u, --unpack
pack_isam.
-v, --verbose
-d and
-e. Use -v multiple times (-vv, -vvv) for more
verbosity!
-V, --version
isamchk version and exit.
-w, --wait
Possible variables for the --set-variable (-O) option are:@:
key_buffer_size current value:@: 16776192 read_buffer_size current value:@: 262136 write_buffer_size current value:@: 262136 sort_buffer_size current value:@: 2097144 sort_key_blocks current value:@: 16 decode_bits current value:@: 9