MySQL Online DDL错误密钥

时间:2018-07-09 19:10:05

标签: java mysql mysql-workbench mysql-error-1064

我正在实现MySQL的-在线DDL,以使用ALGORITHM = INPLACE向表中添加一列来实现“零宕机时间升级”。我执行的查询是

ALTER TABLE documentbase_copy ADD testColumn INT, ALGORITHM=INPLACE, LOCK=NONE;

表的大小非常大,此查询在大小为100万或更小的表上可以很好地工作。但是,当我尝试在表大小为1000万的表上运行它时,出现以下错误-

java.sql.SQLException: Incorrect key file for table 'documentbase_copy'; try to repair it
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:127)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:960)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1116)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1066)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate(ClientPreparedStatement.java:1396)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate(ClientPreparedStatement.java:1051)
    at com.example.Informatica.Threads.EstablishConnection.executeUpdateQuery(EstablishConnection.java:67)
    at com.example.Informatica.Threads.QueryThread.run(QueryThread.java:19)
    at com.example.Informatica.Threads.QueryThread.call(QueryThread.java:33)
    at com.example.Informatica.Threads.QueryThread.call(QueryThread.java:1)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

我不确定“表{}的密钥文件不正确,请尝试修复它”是什么意思。 阅读一些博客后,我尝试修复我的表,但这是一个InnoDB表,无法修复。

请帮助!

P.S-此 MySQL服务器和数据库托管在Amazon-RDS

谢谢!

0 个答案:

没有答案