3

I have one ARCHIVE table that I simply can't repair, I already try to remove the partitioning but still get this error:

alter table promo_tool_view_44 REMOVE PARTITIONING;
ERROR 1034 (HY000): Incorrect key file for table 'promo_tool_view_44'; try to repair it

I already try to repair the table but I get this reply: repair table promo_tool_view_1;

+-----------------------------+--------+----------+-----------------------------+
| Table                       | Op     | Msg_type | Msg_text                    |
+-----------------------------+--------+----------+-----------------------------+
| vad_stats.promo_tool_view_1 | repair | error    | Partition p1 returned error |
| vad_stats.promo_tool_view_1 | repair | error    | Corrupt                     |
+-----------------------------+--------+----------+-----------------------------+

2 rows in set (0.21 sec)

How can I solve this?

Thanks,
Pedro

jscott
  • 24,484
  • 8
  • 79
  • 100
Pedro
  • 667
  • 2
  • 9
  • 20
  • 1
    For ARCHIVE tables the only way I found to fix was to overwrite the table files, from one of the slave servers. But please guys if anyone as one solution for that please help us, to prevent future disasters! – Pedro Mar 08 '10 at 15:05

2 Answers2

2

If you have not done it yet: Shut down your DB and back it up. Repair operations are dangerous.

Sad to say, I would strongly recommend a backup tape. Something is obviously broken in partition p1. But there are some tricks that might get your data back.

myisamchk implements lots of stuff not found in the cli. Try

myisamchk --safe-recover
myisamchk --recover

in that order and see if you have any more luck. There are plenty of flags that can help you. The full documentation can be found at

http://dev.mysql.com/doc/refman/5.5/en/myisamchk.html

The full documentation for repair in the cli can be found at http://dev.mysql.com/doc/refman/5.5/en/repair-table.html

Once you are done repairing you should track down why you got the DB corrupted in the first place. That's is not normal for MySQL databases.

pehrs
  • 8,789
  • 1
  • 30
  • 46
  • Thanks, but I can't use myisamchk because the tables are not MyIsam are in ARCHIVE – Pedro Mar 08 '10 at 12:23
  • Then you are pretty much out of luck. Backups are a nice thing. You could also monitor this bug report which seems to be related http://bugs.mysql.com/bug.php?id=46565 – pehrs Mar 08 '10 at 16:37
  • I have buckups in several slaves, I was able to restore info, but it will be nice to know one way to restore ARCHIVE tables after corruption. – Pedro Mar 08 '10 at 16:48
-1

For ARCHIVE tables the only way I found to fix was to overwrite the table files, from one of the slave servers. But please guys if anyone as one solution for that please help us, to prevent future disasters

Pedro
  • 667
  • 2
  • 9
  • 20