If you can fuck up a database in prod you have a systems problem caused by your boss. Getting fired for that shit would be a blessing because that company sucks ass.
Never fire someone who fucked up (again; it isn’t their fault anyways). They know more about the system than anyone. They can help fix it.
If you are adding guardrails to production… It’s the same story.
Boss should purchase enough equipment to have a staging environment. Don’t touch prod, redeploy everything on a secondary, with the new guardrails, read only export from prod, and cutover services to the secondary when complete.
Sorry, not in budget for this year. Do it in prod and write up the cap-ex proposal for next year.
Small companies often allow devs access to prod DBs. It doesn’t change the fact that it’s a catastrophically stupid decision, but you often can’t do anything about it.
And of course, when they inevitably fuck up the blame will be on the IT team for not implementing necessary restrictions.
Frequent snapshots ftmfw.
I always run my queries in a script that will automatically rollback if the number of rows changed isn’t one. If I have to change multiple rows I should probably ask myself what am I doing.
I always start a session with disabling auto commit (note, I could add it to my settings, but then it would backfire that one time my settings don’t execute, so I’m making it a habit to type it out every time, first thing I connect)
BTW: what kind of genius decides that auto commit should be enabled by default?
Don’t you people have a development environment?
There’s that old saying ‘everyone has a development environment. Some people are lucky enough to have a separate production environment, too’
If he recognized his typo with the space after the D:\ in his restore command he could have been saved at the bargaining stage. I am so glad I don’t work with this stuff anymore.
A few months back I crashed a db in prod. I detached it and when I tried to reattach it simply refused, saying it was corrupted or some shit.
Lucky me we have a backup solution.
Unfortunately it was being upgraded, with difficulties.
That was a long day.