MySql em database repair fails

Document ID : KB000111777
Last Modified Date : 21/08/2018
Show Technical Document Details
Issue:
Repair of the MySql em database fails, on Performance Center

Running a repair we see this problem fixing that table (cut the rest out for brevity): 
opt/CA/MySql/bin/mysqlcheck -uroot -pnetqos -r --databases em 
em.item_members 
error : Can't create new tempfile: './em/item_members.TMD' 
status : Operation failed 

Then ran myisamchk
opt/CA/MySql/bin/myisamchk -uroot -pnetqos -r /opt/CA/MySql/data/em/item_members.MYI 
- recovering (with sort) MyISAM-table '/opt/CA/MySql/data/em/item_members.MYI' 
Data records: 3014875 
myisamchk: error: Can't create new tempfile: '/opt/CA/MySql/data/em/item_members.TMD' 
MyISAM-table '/opt/CA/MySql/data/em/item_members.MYI' is not fixed because of errors 
Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag

Tried a manual repair
Tried manual repair: 
mysql> use em 
Database changed 
mysql> repair table item_members; 
+-----------------+--------+----------+----------------------------------------------------+ 
| Table | Op | Msg_type | Msg_text | 
+-----------------+--------+----------+----------------------------------------------------+ 
| em.item_members | repair | error | Can't create new tempfile: './em/item_members.TMD' | 
| em.item_members | repair | status | Operation failed | 
+-----------------+--------+----------+----------------------------------------------------+ 
Environment:
CA Performance Management 3.6 
Cause:
There was an old, broken file, referenced in the errors above, in the "/opt/CA/MySql/data/em" directory: 
-rw-r----- 1 mysql mysql 21757952 Aug 14 2017 item_members.TMD 
Resolution:
1. rename this file to "item_members.TMD.old", or delete

2. Run /opt/CA/MySql/bin/myisamchk -uroot -pnetqos -r /opt/CA/MySql/data/em/item_members.MYI
 
 - recovering (with sort) MyISAM-table '/opt/CA/MySql/data/em/item_members.MYI' 
Data records: 3014875 
- Fixing index 1 
- Fixing index 2 

3.  Perform a full sync of the Event Manager data source