Realistically, there is no online method for table repait.
There are two techniques to repair mydb.mytable
TECHNIQUE #1 : Repair Online
REPAIR TABLE mydb.mytable;
This will perform the table repair with mysql runnng. This will perform a full table lock so no one can access the table.
TECHNIQUE #2 : Repair Offline
To repair a table offline, move the files making up the table to another folder and perform the repair there. For example, to repair mydb.mytable using the folder /var/lib/mysql
REPAIR_OPTION="-r"
DB_NAME=mydb
TABLE_NAME=mytable
FRM=${TABLE_NAME}.frm
MYD=${TABLE_NAME}.MYD
MYI=${TABLE_NAME}.MYI
cd /var/lib/mysql/${DB_NAME}
mv ${FRM} ..
mv ${MYD} ..
mv ${MYI} ..
cd ..
myisamchk -${REPAIR_OPTION} ${MYD}
myisamchk -${REPAIR_OPTION} ${MYI}
mv ${FRM} /var/lib/mysql/${DB_NAME}
mv ${MYD} /var/lib/mysql/${DB_NAME}
mv ${MYI} /var/lib/mysql/${DB_NAME}
If -r
does not work, rerun these lines using REPAIR_OPTION="-o"
EPILOGUE
Neither of these techniques will allow REPAIR TABLE
operations while the file is live.
According to the documentation, the tool accomplishes its magic of keeping the old and new tables in sync while the copy process is happening via the creation of its own triggers and is therefore not compatible with tables already using triggers no matter what kind of change you intend to make.
Any modifications to data in the original tables during the copy will be reflected in the new table, because the tool creates triggers on the original table to update the corresponding rows in the new table. The use of triggers means that the tool will not work if any triggers are already defined on the table.
— http://www.percona.com/doc/percona-toolkit/2.1/pt-online-schema-change.html
Best Answer
Yes there are.
DB doesn't have any triggers. A table can has triggers. If you want to alter the table which hasn't fulltext index maybe online DDL can help you.(It is implemented in MySQL/MariaDB)
But gh-ost is the best choose when you have triggers on the table.
Percona Online schema change and another tools such as oak-online-alter-table,soundcloud/lhm, facebook-osc are good when your table doesn't have any triggers. But in MariaDB 10.2 you can create multiple triggers for the same event So maybe they can work (I did not test)
Tools that maybe you didn't know:
https://github.com/soundcloud/lhm
https://github.com/shlomi-noach/openarkkit
https://dev.mysql.com/doc/refman/5.6/en/innodb-create-index-overview.html