peter <cmk128 (AT) gmail (DOT) com> wrote:
Quote:
If I have thousand tables, how can I know which one is corrupted quickly? |
Corrupted tables are 99.9% a MyISAM problem. If you suspect that a
significant number of your tables is corrupt (i.e. after a crash)
then the best solution would be to stop MySQL (to not start it in
the first place) and run
myisamchk --fast --force $DATADIR/*/*.MYI
this will check all MyISAM tables and repair those that are corrupt.
You want to set the respective options either on the command line or
in my.cnf to have myisamchk make good use of your machines memory.
-> http://dev.mysql.com/doc/refman/5.1/en/myisamchk.html
If the server is already running, then CHECK TABLE is your friend.
In order to check all tables, use the mysqlcheck client tool (which
in turn will run CHECK TABLE and REPAIR TABLE on individual tables).
-> http://dev.mysql.com/doc/refman/5.1/en/mysqlcheck.html
Yet another possibility is to enable automatic recovery for MyISAM
tables. When a (suspectedly) corrupted table is opened, it will
then be checked and repaired automatically.
-> http://dev.mysql.com/doc/refman/5.1/...myisam-recover
XL