Practical eCommerce

 

Repairing Database Tables

Author: Brian Getting
Publish Date: July 29, 2006
Blog: Developers' Corner
Tags: mysql, repair

avatar

It's a beautiful Friday night at around 11 pm, and what do I get to do? I get to repair tables in our databases. As some of you may have noticed, there were some server upgrades done today on our hosting servers, and I believe it required a re-start of the system. For whatever reason, the database that holds the content for our website had some corrupted tables. In fact, one of our forum members was kind enough to point that out to me, which I appreciate since it could have been that way all weekend.

Essentially what had happened is that one of the larger tables in the database (which stores IP addresses and has a TON of records in it) somehow had the index file crash (?), according to the error being generated in place of the content on our site. Since we use MySQL as a database, it was an easy fix as all I had to do was fire the following command at MySQL:

REPAIR TABLE table_name

Obviously that is a fake table name, but you get the idea. MySQL repaired the table and kicked back a message that everything was OK. Since after that it checked out alright, and the website is back to normal, I figure the problem is solved. However, I have a strange feeling that I will probably need to change the method by which the site tracks IP addresses. In case anyone shudders at that thought, and thinks that represents a privacy concern, I assure you that ONLY the IP address is stored, and used to determine whether our advertisements are being seen for the first time (unique impressions) or for a repeated time (repeat impressions). All of that data is available in real time to our advertisers, so that they can gauge the performance of their ad campaigns. Back on track, there is going to have to be a change to avoid repeat data in the database next time we rebuild the website. The important thing is that the repairs are made, and at least for the next year or so there should be no worries about this anymore.

Sorry for the inconvience of the server upgrades, as well as the database errors that occurred today. Hopefully it did not affect too many folks. Have a great weekend, everyone.

Add a Bookmark: Add 'Repairing Database Tables' to Del.icio.us Digg 'Repairing Database Tables' on Digg.com Submit 'Repairing Database Tables' to reddit.com Blink 'Repairing Database Tables' Add 'Repairing Database Tables' to dzone Seed 'Repairing Database Tables' on Newsvine Add 'Repairing Database Tables' to Furl Add 'Repairing Database Tables' to Spurl Add 'Repairing Database Tables' on simpy.com Add 'Repairing Database Tables' to fark.com BlogMark 'Repairing Database Tables' Add 'Repairing Database Tables' to Yahoo! myweb2 Add 'Repairing Database Tables' to wists.com Stumble It!

0 Comments

Sign-up to receive EcommerceNotes, our acclaimed email newsletter.

View A Sample | Privacy

Bloggers Wanted

We’re looking for merchants and other ecommerce professionals to share their experiences with our readers. If this interests you, we invite you to contact us.

Inside Practical eCommerce