<< previous page   --   table of contents   --   next page >>
| | | | | | | |
  • Return to Table of Contents
  • Table of Contents

    1. General Information
    2. MySQL Installation
    3. Tutorial Introduction
    4. Database Administration
    5. MySQL Optimisation
    6. MySQL Language Reference
    7. MySQL Table Types
    8. MySQL APIs
    9. Extending MySQL

    242 MySQL Technical Reference for Version 4.0.3 4.4.7  Setting Up a Table Maintenance Regimen Starting with MySQL Version 3.23.13, you can check MyISAM tables with the CHECK TABLE command.  See Section 4.4.4 [CHECK TABLE], page 229.  You can repair tables with the REPAIR TABLE command.  See Section 4.4.5 [REPAIR TABLE], page 230. It is a good idea to perform table checks on a regular basis rather than waiting for problems to occur.  For maintenance purposes, you can use  myisamchk -s  to check tables.  The  -s option (short for --silent) causes myisamchk to run in silent mode, printing messages only when errors occur. It's also a good idea to check tables when the server starts up.  For example, whenever the machine has done a reboot in the middle of an update, you usually need to check all the tables that could have been a ected.  (This is an \expected crashed table".)  You could add a  test  to  safe_mysqld  that  runs  myisamchk  to  check  all  tables  that  have  been  modi ed during the last 24 hours if there is an old `.pid' (process ID) le left after a reboot.  (The `.pid' le is created by mysqld when it starts up and removed when it terminates normally. The  presence  of  a  `.pid'   le  at  system  startup  time  indicates  that  mysqld  terminated abnormally.) An even better test would be to check any table whose last-modi ed time is more recent than that of the `.pid' le. 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' le: 35 0 * * 0 /path/to/myisamchk --fast --silent /path/to/datadir/*/*.MYI This prints out information about crashed tables so we can examine and repair them when needed. As  we  haven't  had  any  unexpectedly  crashed  tables  (tables  that  become  corrupted  for reasons other than hardware trouble) for a couple of years now (this is really true), once a week is more than enough for us. We recommend that to start with, you execute myisamchk -s each night on all tables that have been updated during the last 24 hours, until you come to trust MySQL as much as we do. Normally you don't need to maintain MySQL tables that much.  If you are changing tables with dynamic size rows (tables with VARCHARBLOB or TEXT columns) or have tables with many deleted rows you may want to from time to time (once a month?) defragment/reclaim space from the tables. You can do this by using OPTIMIZE TABLE on the tables in question or if you can take the mysqld server down for a while do: isamchk -r --silent --sort-index -O sort_buffer_size=16M */*.ISM myisamchk -r --silent --sort-index   -O sort_buffer_size=16M */*.MYI 4.4.8  Getting Information About a Table
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN REGISTRATION
    MANAGE YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    SITE MAP
    Home
    Hosting Plans | Domain Registration | About Us | Contact Us | Site Map
    Terms of Use | Privacy Policy | Guarantees
    Merchant Accounts

    SpiritHost - web hosting for spiritual and education sites
    SpiritHit.com - Religious and Spiritual Portal
  • Return to Table of Contents
  • Back to top

  • Web Hosting: Manuals & FAQ's

    1. Unix-Based Web Hosting
    2. Unix Dedicated Servers
    3. Windows Dedicated Servers
    4. CuteFTP User’s Guide
    5. CuteHTML User’s Guide
    6. WS_FTP Pro User's Guide
    7. Miva Order User's Guide
    8. Miva Merchant User's Guide