Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
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 8 '10 at 15:05

2 Answers 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.

share|improve this answer
    
Thanks, but I can't use myisamchk because the tables are not MyIsam are in ARCHIVE –  Pedro Mar 8 '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 bugs.mysql.com/bug.php?id=46565 –  pehrs Mar 8 '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 8 '10 at 16:48
up vote 0 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.