# Enable keys and table crash

**URL:** <https://forums.percona.com/t/enable-keys-and-table-crash/1076>\
**Category:** Other MySQL® Questions\
**Created:** [February 6, 2009, 6:28am UTC](https://forums.percona.com/t/enable-keys-and-table-crash/1076 "2009-02-06T06:28:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jigo](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@jigo](https://forums.percona.com/u/jigo)\
**Post date:** [February 6, 2009, 6:28am UTC](https://forums.percona.com/t/enable-keys-and-table-crash/1076/1 "2009-02-06T06:28:41Z")

</div>

Hello,

I have a problem on my MySQL server. I have a big table (3G), with multiple index, so I want daily delete some data for this table.

My table is name ‘T1’. So, my process is :

RENAME TABLE T1 TO oldT1;  
CREATE TABLE T1 LIKE oldT1;  
LOCK TABLE T1 write, oldT1 read;  
ALTER TABLE T1 DISABLE KEYS;  
INSERT INTO T1 SELECT \* FROM T2 WHERE `mydate` \>= ‘2009-02-01’;  
ALTER TABLE T1 ENABLE KEYS;  
UNLOCK TABLES;

Ok.

But when i do a “show status” when the query is making “ALTER TABLE T1 ENABLE KEYS;”, my log says :

Table ‘./test/T1’ is marked as crashed and should be repaired

The probleme is only view when MySQL is enabling keys.

T1 is a big table, but there is the same probleme with other table. When MySQL is querying a table Tx during an “enabling keys” on Tx, then the table is marked as crashed.

Any Idee?

Thanks.

---

<div class="post-metadata">

**Author:** ![xaprb](https://avatars.discourse-cdn.com/v4/letter/x/49beb7/32.png) [@xaprb](https://forums.percona.com/u/xaprb)\
**Post date:** [December 25, 2009, 10:15am UTC](https://forums.percona.com/t/enable-keys-and-table-crash/1076/2 "2009-12-25T10:15:09Z")

</div>

The table’s indexes are not fully built, so the table is not usable yet. Wait until the ENABLE KEYS is done.
