top | item 39479481

(no title)

tedchs | 2 years ago

I did this, around 2005, but I dropped ALL the prod tables. I was using a SQL GUI called Toad (awesome) and had separate windows open, for both "dev" and "prod". I was trying to reset the dev database, and used the wrong window. Thankfully, the "real" DBA at the time had 15-minute backups, and was able to restore it, and then I replayed a few transactions from logs. Lesson learned!

> While building a feature, we performed a database migration command locally, but it incorrectly pointed to the production environment instead, which dropped all tables in production.

discuss

order

JackFr|2 years ago

I deleted a years worth of trades on a production database for a bond trading system in 1997. They were restored within an hour, but it made a lasting impression.

Different color scheme on prod consoles.

Always use “BEGIN TRAN”.

tetha|2 years ago

This is why I've conditioned myself: Once I start running unsafe commands in a development-ish pattern (DDL changes, reboots, service starts/stops and such), I make sure to close any shell to productive systems and databases first. They are color-coded differently, normal users don't have these permissions and so on and so on, sure.

But it's better not to have these shells open and available to accidentally choose them once my brain switches from ops-mode to dev-mode.