Repairing Tables on MySQL
Posted by , Last modified by Aly Essa on 08 June 2016 06:53 PM

Overview

MySQL tables may need to be repaired if the following errors are found in FileCatalyst Workflow or FileCatalyst Webmail logs:

2013-01-14 16:08:45,686 ERROR sys  -   Error on Query: SELECT * FROM DOCTERA_PRINTFILES WHERE jobID='OO1EU846RUN9ZJ20'
Error Message is: Table 'DOCTERA_PRINTFILES' is marked as crashed and should be repaired
2013-01-14 16:08:45,686 ERROR user  - Error in getFilesForJob
java.sql.SQLException: Table 'DOCTERA_PRINTFILES' is marked as crashed and should be repaired
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3536)

 

Environment

FileCatalyst Workflow v4.9 and later.

FileCatalyst Webmail v4.9 and later.


Resolution

Repairing MYSQL Tables

  1. Backup of your MySQL database before attempting to repair any of the tables.
  2. Run the MYSQL command line tool.
  3. Run the use command to point to the database used by your FileCatalyst Workflow or Webmail product. For example:

    use workflow or use webmail or use fcweb

  4. Execute show tables command. The result should look like:

    doctera_anonymous_users
    doctera_contacts
    doctera_groups
    doctera_jobarchive
    doctera_jobs
    doctera_logs
    doctera_printfiles
    doctera_userprefs
    doctera_users

  5. Check the tables by using check table command. Use the following command:

    CHECK TABLE DOCTERA_ANONYMOUS_USERS, DOCTERA_CONTACTS, DOCTERA_GROUPS, DOCTERA_JOBARCHIVE, DOCTERA_JOBS, DOCTERA_LOGS, DOCTERA_PRINTFILES, DOCTERA_USERPREFS, DOCTERA_USERS extended;

    Your results will look like:

    Table Op Msg_Type Msg_Txt
     workflow.doctera_anonymous_users check status OK
     workflow.doctera_contacts check status OK
     workflow.doctera_groups check status OK
     workflow.doctera_jobarchive check status OK
     workflow.doctera_jobs check status OK
     workflow.doctera_logs check status OK
     workflow.doctera_printfiles check status OK
     workflow.doctera_userprefs check status OK
    workflow.doctera_users check status OK

     

  6. Run the repair command for the tables that require repair. That is for any table which does not return the status of OK. The command would look like:

    REPAIR TABLE DOCTERA_ANONYMOUS_USERS, DOCTERA_CONTACTS, DOCTERA_GROUPS, DOCTERA_JOBARCHIVE, DOCTERA_JOBS, DOCTERA_LOGS, DOCTERA_PRINTFILES, DOCTERA_USERPREFS, DOCTERA_USERS extended;

  7. Additionally, you can run a single line repair and optimization command after backing up your database:

    mysqlch.eck -u root -p --auto-repair --check --optimize --all-databases