?

Log in

No account? Create an account

[icon] I saved someone's bacon - Patti
View:Recent Entries.
View:Archive.
View:Friends.
View:Profile.
View:Website (pattib.org).

Security:
Subject:I saved someone's bacon
Time:01:45 pm
Part of my job involves going in and hand-altering our production databases on a regular basis, and occasionally repairing production servers. Don't ask... just take it as a given. The other half of my group is a guy who is wicked fucking smart, but was very junior when he started. He can pretty much always figure out how to do what needs to be done, but I've been teaching him good habits-- things like always make a backup before you fuck with something, have a second person watch over your shoulder for big changes, and for databases always use transactions and doublecheck your changes before you commit them.

Apparently while I was in Vegas he screwed up a change and typed:
update table set foo=x, bar=y
rather than
update table set foo=x where bar=y
and because I'd taught him good habits he was able to recover and undo the change with one rollback rather than a full database restore.

It's a rite of passage for any tech person to make a big mistake and fuck up a system. The lucky ones learn why they should be thankful for having been taught good data-handling practices. The unlucky ones learn how to mop up after a big mess.

My coworker and I have independently concluded that MySQL should alias the word "fuck" to "rollback".
comments: Leave a comment Previous Entry Share Next Entry


gayathri
Link:(Link)
Time:2010-06-28 08:47 pm (UTC)
Geeks! :)
(Reply) (Thread)


adb_jaeger
Link:(Link)
Time:2010-06-28 10:17 pm (UTC)
Part of my job involves going in and hand-altering our production databases on a regular basis

A long long time ago, when I was doing consulting at Bell Atlantic, we had a supervisor who had an ironclad rule: "You cannot change the production database while we're running".

Needless to say, that didn't last very long, once we were live. It's a nice thought, but it's very naive.
(Reply) (Thread)


whipartist
Link:(Link)
Time:2010-06-28 10:24 pm (UTC)
Yeah, that's insane.

My ironclad rule is that you must use transactions and verify your changes for the production database. Many of our changes are fairly routine, e.g. "Please backdate this change to June 1."

If it's a non-routine change, you must have a second person walk through it with you, you must back up the relevant table(s) first, and if it makes sense to do so you must test it out on a backup copy of the production database first.
(Reply) (Parent) (Thread)


whitebird
Link:(Link)
Time:2010-06-29 05:47 am (UTC)
You have no idea how hard it is to tell instructors that they should be telling their students things like this when teaching them the basics.

(From what I've experienced with instructors I know, nigh well impossible.)

I'm glad your co-worker learned first and well from you!
(Reply) (Parent) (Thread)


evwhore
Link:(Link)
Time:2010-06-29 12:47 am (UTC)
Another habit you should teach him quickly is: always type the WHERE clause first.
(Reply) (Thread)


filthy_habit
Link:(Link)
Time:2010-06-29 01:34 am (UTC)
I take it there's no warning that pops up that says "Hey! Dummy! You're gonna change every record [row] in that file [table]!"

Gotta love an iSeries...
(Reply) (Thread)


whipartist
Link:(Link)
Time:2010-06-29 05:33 am (UTC)
At a MySQL command line? No, I don't think so.

What is an iSeries?
(Reply) (Parent) (Thread)


filthy_habit
Link:(Link)
Time:2010-06-29 06:06 am (UTC)
iSeries is the old AS/400 (I think they call them i5's right now, but I lose track). Best damn 'puter on the planet. My specialty for about 20+ years.
(Reply) (Parent) (Thread)

[icon] I saved someone's bacon - Patti
View:Recent Entries.
View:Archive.
View:Friends.
View:Profile.
View:Website (pattib.org).