MyISAM “Table is marked as crashed” recovery

November 9th, 2011 No comments

With my new job comes a significant element of MySQL DBA work. It is also opportunity to help my fellow MySQL DBAs by sharing tools, tips and tricks so expect more frequest blog posts!

Today I had to recover a from a bunch of corrupt MyISAM tables in a “cache database”. Client code will throw an exception if these tables are accessed so it is not a good idea to let corrupt tables hang around for long. The fix was in theory easy – just recreate the tables and then rename the corrupt table, rename the new table to the old and then run myisamchk on the old table.

The problem is that “create table foo as bar” does not work if the table is marked as crashed. Some Google-fu found this.

Refer to the MyISAM bit – it really does work. I wrote a bash script to automate it which you can grab here.

However, there is an even quicker way. I discovered that a simple “rename table foo to foo_corrupt” will create a fresh, clean copy of table foo. Not sure if this is intentional but thanks MySQL!

Oh, and sadly these tables cannot be converted to InnoDB – we’re using “INSERT DELAYED” and for some other reasons.


Categories: Technical Tags:

Farewell Xbox XBMC

August 2nd, 2010 1 comment

It is with some sadness that I learnt Team XBMC has decided to cease official development of the Xbox branch of XBMC. Reading the comments on the article and you will discover that despite this era of Hi-Def video formats and Blu-Ray, there is still a large number of people perfectly happy on standard definition and the Xbox. If some of the comments are to be believed, one can actually play some 720p content on the Xbox at an acceptable framerate! (when I tried this the film looked more like a comic strip in terms of frame rate ;-)

I make no apology for being an unabashed XBMC fan. XBMC > MythTV (and the user community is actually helpful, unlike the MythTV people who will sneer at you). I have several systems at home. One is even modded with a remote power on sensor. It completely blew me away when I first completed a softmod and installed XBMC for the first time. It turned the humble Xbox into a lean, mean media center machine that does an absolutely superb job. Being on the Xbox means one benefits from super-fast boot up and ready connection to a TV and audio system. Got a Hi-Def TV? Then use component video out with the 720p skin for an amazingingly sharp crisp picture. Got a surround sound system? Then use optical digital out to pipe Dolby Digital or DTS to your amplifier. Got a DVD or CD to playback? No problem with the in-built DVD-ROM drive – oh, and it will rip your CDs to HDD at the click of a button too. I think DVDs are upscaled when watching in Hi-Def mode too, Star Wars: A New Hope DVD looked amazing through it. Your media is on a NAS? Hook your switch to the Ethernet port on the back and share via Samba/CIFS or UPnP. And I have not even mentioned emulators like MAME yet. Add the in-built support for the Xbox DVD remote control and all in all, the Xbox platform is almost the ideal appliance for a media centre!

You can pick up a second hand Xbox these days for £10. If you want to enjoy your movies, music or pictures through your large screen telly, I urge you to buy one and try XBMC. You won’t look back I guarantee it.

It looks like the Xbox branch will live on at a new home. There is life in the humble Xbox yet!

Categories: Technical Tags: ,

Very neat Android Web Widget

July 5th, 2010 No comments

I thought this was cool, I can sync my installed apps using this web widget from AppBrainz. Check it out…

Categories: Technical Tags:

QR Codes

June 22nd, 2010 No comments

qrcode

Heard of QR Codes? Yet another useful invention from Japan. Extremely useful in this era of mobile devices that have usable web browsers. You might have seen them on Coke cans these days or more commonly on web pages for mobile apps. And those of you who have been to the far east might even have seen them in adverts on the sides of buses in Singapore! Create your own and have a play with them here. Android users should hit the Market and get the Barcode Scanner app to scan in the above code.

Have fun! ;-)

Categories: Uncategorized Tags: ,

Sysadmin Book Review

June 13th, 2010 No comments

I was recently asked to review an Apress book on Linux Sysadmin – check it out and let me know what you think or indeed feel free to suggest books useful to you on this topic.

Ciao!

Categories: Technical Tags: , ,