table checking best practices
Posted by: Andrew Brosnan
Date: August 24, 2005 02:41PM

Hello,

I am looking to set up table checking/maintenance system and I am confused about some of the documentation. In the docs it says:

> The recommended way to quickly check all MyISAM and ISAM tables is:
>
> shell> myisamchk --silent --fast /path/to/datadir/*/*.MYI
> shell> isamchk --silent /path/to/datadir/*/*.ISM

The docs go on to say:

> You must ensure that no other program is using the tables while you
> are running myisamchk...The easiest way to avoid this problem is to
> use CHECK TABLE instead of myisamchk to check tables.

OK, so which is the recommended way? Well, I want to do it via a cronjob rather than manually so I guess stick with myisamchk? Ahh...there's a section on table maintenance systems:

> It is a good idea to perform table checks on a regular basis ... One
> way to check and repair MyISAM tables is with the CHECK TABLE and
> REPAIR TABLE statements.

Alright, perhaps CHECK TABLE *is* better...but wait, later in that section of the docs:

> You should also check your tables regularly during normal system
> operation. At MySQL AB, we run a cron job to check all our important
> tables once a week, using a line like this in a crontab file:
>
> 35 0 * * 0 /path/to/myisamchk --fast --silent /path/to/datadir/*/*.MYI
>
> This prints out information about crashed tables so that we can
> examine and repair them when needed.

Perfect! Just what I wanted! And that's the way the MySQL AB folks do it so it must be the best way. But wait...that doesn't ensure that no other program is using the tables while I'm running myisamchk as the docs suggest above.

Hmmmm...

What *is* the best way?

Regards,
Andrew

Options: ReplyQuote


Subject
Written By
Posted
table checking best practices
August 24, 2005 02:41PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.