News for hackers. Stuff that matters.
Re:An administrator accidentally deleted the production data... by arethuza on Wednesday March 23, 2016 @07:19AM (#11343453)
My very first job - ~25 years ago.

Destroyed the production payroll database for a customer with a bug in a shell script.

No problem - they had 3 backup tapes.

First tape - read fails.

Second tape - read fails.

Third tape - worked.... (very nervous at this point).

I think most people have an equivalent educational experience at some point in their careers.

Edit: Had a project cancelled for one customer because they lost the database of test results..... 4 months work! Their COO (quite a large company) actually apologised to me in person!

Edit: Also had someone from Oracle break a financial consolidation system for a billion dollar company - his last words were "you need to restore from tape" and then he disappeared. I was not happy as it was his attempts at "improving" things were the cause of the incident! Wouldn't have been angry if he had admitted he had made a mistake and worked with us to fix it - simply saying "restore from tape" and running away was not a good approach.

Re:An administrator accidentally deleted the production data... by roflc0ptic on Wednesday March 23, 2016 @08:55AM (#11343951)
A coworker of mine used to say "It's not the backup, it's the restore." Meaning your backup process isn't meaningful unless you have a tested and effective means for recreating your system from that backup. It has stuck with me.
Re:An administrator accidentally deleted the production data... by arethuza on Wednesday March 23, 2016 @09:19AM (#11344115)
It's important to check that not only can you restore the database but you also check that it contains the data you think it contains.

Finding out that your backup consists of a perfectly backed up empty database isn't much fun!

Re:An administrator accidentally deleted the production data... by wlll on Wednesday March 23, 2016 @10:23AM (#11344703)
One of the first things I did at my current place was to add a Nagios check "Is the most recent backup size within x bytes of the previous one". It wasn't comprehensive, but was fast to implement and was later replaced with full restores and checks, but nevertheless a few weeks later it caught a perfectly formed tar.gz of a completely empty database due to a bug that would have continued creating empty archives until it was fixed.
Re:An administrator accidentally deleted the production data... by saidajigumi on Wednesday March 23, 2016 @02:10PM (#11346820)
This is a fantastic illustration of testing 101: often it's the dumbest possible checks catch huge errors. Get those in place before overthinking.

E.g. a team adjacent to mine years ago had a dev who made a one-character typo in a commit that went to production. Which caused many $MM to incorrectly flow out the door post-haste. The bad transactions were fortunately reversible with some work, but I was floored that there were no automated tests gating these changes. It wasn't a subtle problem. The most basic, boring integration test of "run a set of X transactions, check the expected sum" would have prevented that failure.

Re:An administrator accidentally deleted the production data... by chris_wot on Wednesday March 23, 2016 @06:57PM (#11348979)
All these threads are complete gold mines of years of hard won experience and system administration tips! Fascinating, especially the war stories I'm reading - both hilarious and horrifying in equal measure.
Re:An administrator accidentally deleted the production data... by KB1JWQ on Wednesday March 23, 2016 @11:01AM (#11345078)
And as Gliffy is discovering to their detriment, exactly how long said restore takes...
Re:An administrator accidentally deleted the production data... by vonklaus on Wednesday March 23, 2016 @12:08PM (#11345704)
Resonates. I didn't spend the extra $5 to get a USB 3.0 Flash Drive. Currently the read process for the image backup looks like it will take 4 hours to create write media, 2 to actually restore. Good lesson above about te restore being more inportant than backup.

Wish I learned that.

Re:An administrator accidentally deleted the production data... by mkhalil on Wednesday March 23, 2016 @03:12PM (#11347345)
This morning I backed up my iPhone with iTunes. Once finished iTunes said backup was successful. Then formatted my iPhone, and went to restore. It say's the backup was corrupt.

Tried some closed source iTunes Backup fixer, didn't work.

Pretty heated right now, but oh well, what can I do? I guess I'll just have to start over. Thankfully I am a iCloud Photo Library subscriber.

So yes, can confirm, "It's not the backup, it's the restore."

Re:An administrator accidentally deleted the production data... by CaptSpify on Wednesday March 23, 2016 @10:20AM (#11344668)
If you've never restored the backup, you haven't backed-up.
Re:An administrator accidentally deleted the production data... by KMag on Wednesday March 23, 2016 @11:19AM (#11345246)
My first job was doing software engineering consulting. My main client was a defense contractor. We wanted to at least use cvs or svn for source control, but you wouldn't believe the red tape associated with getting approval to use a free source control system... so we used date-named zip files for "source control". The rule was the last person out at the end of the day zipped up the shared drive contents and shut off the lights.

Though, we were required to keep good backups. 3 sets of tapes.. 1 always in the tape drive, 1 always in a fire-proof bomb-resistant bunker, and one sometimes in transit to or from the bunker.

Our manager was paying some obscene sum for this backup service, so I suggested we just hide one of the daily backup zip files and pretend we deleted it. The head of the group humored my request. It turned out that nobody was monitoring the tape or the backup job. The tape had filled up and nobody had swapped tapes and called the bunker courier.

Luckily, they at least used PVCS for configuration management of the releases. No source control for development, but every time we cut a release of the software, the head office sent over no fewer than 3 people to literally watch over our poor release guy's shoulder as he zipped up the source, built the binaries, checked both into PVCS, and burned two CDs of binaries and source.

Defense industry... things you're required to do get done in triplicate. Things you're not required to do, but cost no money and significantly reduce risk, take approvals from 5 different people 9 levels above you. I guess how often the backup tape needed to be checked for available space was insufficiently specified.

On a side note, at that client I also once sat quietly in a meeting for 30 minutes watching two grown men argue over if my use of "will" in a design document needed to be changed to "shall". I didn't care, and right away said I was fine changing the word to "shall", but the second reviewer was adamantly opposed to unnecessary changes.

Re:An administrator accidentally deleted the production data... by ratboy666 on Wednesday March 23, 2016 @12:51PM (#11346132)
"Will" to "Shall" -- very important legal distinction. Thank the second reviewer. Your job in "software engineering consulting" was actually managing risk.
Re:An administrator accidentally deleted the production data... by KMag on Wednesday March 23, 2016 @02:22PM (#11346932)
Except that, as mentioned, this was a software design document and not a legal document. I described intended behavior of a software component. There's no ambiguity in using "will" or "shall" since software does not (at least did not at that time) have intent and does not make promises.

I tried to avoid argument because it didn't matter, not because I thought my word choice was incorrect. It was an internal document describing intended software behavior, to help the poor soul who had to maintain that code.

"When 'shall' is used to describe a status, to describe future actions, or to seemingly impose an obligation on an inanimate object, it's being used incorrectly."[0]

[0]https://law.utexas.edu/faculty/wschiess/legalwriting/2005/05...

Re:An administrator accidentally deleted the production data... by marklyon on Wednesday March 23, 2016 @05:52PM (#11348566)
I have a similar issue.

Formerly critical tool (now, sole repository of necessary historical information) that runs only on an outdated stack and for "copy protection" has critical data in an undocumented, obfuscated DAT file. It also requires a parallel port dongle, which it checks for as part of every read operation. The vendor went bust a decade before I was ever hired.

I've automated a 'backup to zip file' each time the application terminates. It's saved me more than once - it's easy to clobber the data in the thing and the users have a tendency to screw it up when trying to navigate its cryptic keystroke-driven interface.

Trying to export all the legacy data into a new tool met with incredibly frustration the couple of times we tried. It all becomes irrelevant in late 2017 and there's been a new system in place since 2007, so this abomination needs to only live on for a little while longer.

Re:An administrator accidentally deleted the production data... by saidajigumi on Wednesday March 23, 2016 @02:16PM (#11346882)
When appropriate, this is why I adore full-disk, bootable system backups. Plug a backup drive in, spot-check the contents (e.g. by data priority), run a filesystem compare tool, boot from it, etc. Backup is easy, as is restore and testing. A booted backup drive can restore to a replaced system drive.

That's obviously not the right solution for many IT-centric backup needs, but when full-disk backup became cheap and easy it set a new standard in how I think about backup and restore process everywhere.

Re:An administrator accidentally deleted the production data... by toxican on Wednesday March 23, 2016 @09:20AM (#11344124)
This entire discussion has me wanting to backup (and test) everything that I can get my hands on.
Re:An administrator accidentally deleted the production data... by ollybee on Wednesday March 23, 2016 @10:35AM (#11344809)
World Backup Day — March 31st
Re:An administrator accidentally deleted the production data... by langseth on Wednesday March 23, 2016 @11:56AM (#11345573)
World Restore Day April 1st
Re:An administrator accidentally deleted the production data... by yongjik on Wednesday March 23, 2016 @01:36PM (#11346525)
Postmortem on date field mismatch following backup/restore procedure of the World: Octocember 99st
Re:An administrator accidentally deleted the production data... by chris_wot on Wednesday March 23, 2016 @12:33PM (#11345950)
What could possibly go wrong?
Re:An administrator accidentally deleted the production data... by foxpc on Wednesday March 23, 2016 @10:43AM (#11344893)
As long as it's not February 29th.
Re:An administrator accidentally deleted the production data... by piffey on Wednesday March 23, 2016 @09:47AM (#11344331)
Had the same training from the head of operations at my first gig. If you don't restore the backup each time it's pulled to verify it's valid as a test then it's a risk.
Re:An administrator accidentally deleted the production data... by technion on Thursday March 24, 2016 @07:49PM (#11357474)
This is made more serious in practice by the continual recurrence of bugs in Backup Exec over the last several versions, which would often manifest as "backups ran fine, verify ran fine, restores claim to run fine. But all your restored files are 0 bytes long".
Re:An administrator accidentally deleted the production data... by slavik81 on Wednesday March 23, 2016 @04:09PM (#11347778)
How do you do test your restore without destroying the only trustworthy copy of your data?
Re:An administrator accidentally deleted the production data... by ziziyO on Wednesday March 23, 2016 @04:25PM (#11347912)
Do it in the Staging or User Acceptance Testing environment.
Re:An administrator accidentally deleted the production data... by twic on Wednesday March 23, 2016 @08:15PM (#11349519)
This is the right answer! You want a staging/acceptance/mirror environment that's the same as production, right? So make it with nightly restores of the production backups. You get a crisp, fresh staging environment, and regular validation of your backups too. Just remember to run full production monitoring against your staging environment too.
Re:An administrator accidentally deleted the production data... by vacri on Wednesday March 23, 2016 @08:20PM (#11349552)
A friend of mine has his staging databases restored every morning (and anonymised) from the previous day's production backup.
Re:An administrator accidentally deleted the production data... by jlgaddis on Wednesday March 23, 2016 @05:57PM (#11348598)
Restore it elsewhere.
Re:An administrator accidentally deleted the production data... by jowiar on Wednesday March 23, 2016 @11:57AM (#11345576)
Made that mistake once. I was interning at the IT Helpdesk at a Pharma Startup. Our CEO calls us one day, informing us that he deleted a slide deck, and was wondering if we could do anything about it. We dutifully attempt to restore from tape, to find the tapes blank and that our backup has done literally nothing for the past month. Thankfully, the data loss was nothing more severe, but the lesson stuck.
Re:An administrator accidentally deleted the production data... by disordinary on Wednesday March 23, 2016 @04:50PM (#11348107)
In my last job I was a member of an IT team of three, one guy was the CIO + he did sysadmin and IT support for an office of about 60. I did sysadmin and support for about half a dozen offices, 200 odd staff, in two countries with a geographical spread of several hundred kilometres. The third guy was support and sysadmin for our US office which had about 12 people (cushy job). I popped out there once for a week or so to help train the guy on our new systems. They had an old backup system that copied diffs to disk which he had to take home every day, but he didn't like doing that so they invested in a very expensive off site system. I was having a dig around when I was over there and it appeared to me that the diffs hadn't been happening. I confronted the guy and he said that he hadn't set it up yet and knew that would bite him in the ass eventually. They hadn't run any backups for six months, but he had been giving positive reports to both his manager and the rest of the IT team about the hard work he was putting in setting it up, and how it had been so reliably backing up, we celebrated when the first full copy of data finally finished, etc. Needless to say he lost his job.

We were very lucky that I caught it.

Re:An administrator accidentally deleted the production data... by vacri on Wednesday March 23, 2016 @07:59PM (#11349430)
We were using an external vendor for our production database (I've changed this now) and I was poking around their management console one morning when I notice something (I was about two months into this gig). The CTO walks into the office at that point and I ask him: "Hey, I can see that the staging database is being backed up, but the prod database doesn't have any backup files. Where are the backups for prod?". His response: "Press that manual backup button immediately, please." Turns out that production had been running for nearly three years without backup actually running...
Re:An administrator accidentally deleted the production data... by gr3yh47 on Wednesday March 23, 2016 @08:12AM (#11343694)
I got fired from a (sysadmin) job because a servo in a tape library failed while i was working 14h days on conference that I was told was "my only priority".

We didn't need the backups at all, prod was fine, and I found out 2 business days after the servo failed when the conference was over. apparently 2 days of not having backups due to a mechanical failure out of my control was beyond unacceptable.

Re:An administrator accidentally deleted the production data... by bigchewy on Wednesday March 23, 2016 @10:28AM (#11344750)
in the early 2000s I was a young guy and board observer on a .com that was growing extremely rapidly and had a 9 day complete outage.

The venture funds, including the one I was part of, came in screaming, "who's getting fired for this", to which the CEO responded: "are you kidding me? We just spent $1.5M educating this team and you want me to hand them over to our competition?"

Every investor and other board member got real quiet, realizing how correct the CEO was. Good CEOS recognize that mistakes happen. The best make sure they retain the people that have learned through those mistakes.

Re:An administrator accidentally deleted the production data... by btilly on Wednesday March 23, 2016 @01:39PM (#11346550)
Early 2000s, 9 day complete outage.

Don't know if that was the same one, but happened to me at Rent.com. The story is that a change in a shell script meant that backups were not actually being sent properly to tape. That was OK, there was another online backup copy. But the restore process deleted that for 1 hour each day before it was recreated.

The production database died during that hour. We had to take the last good backup (several months earlier) and replay WAL logs to bring it up to date.

The sysadmin whose mistake it was offered her resignation, and was turned down by the head of tech because he knew she wouldn't have made it if she had a more reasonable load. The head of tech offered his resignation to the CEO and was turned down because the CEO knew that it was due to incorrect company priorities.

The next tech hire was a DBA whose sole task was make sure that we have multiple levels of verified backups.

In less than a year we were sold to eBay at a nice price. Part of the reason was that they thought that the way that we handled failure said very positive things about the organization.

Re:An administrator accidentally deleted the production data... by chris_wot on Wednesday March 23, 2016 @07:03PM (#11349016)
And this is how you run a business. It seems every person who worked with you had integrity and true leadership in spades!

That's rare. Too rare!

Re:An administrator accidentally deleted the production data... by btilly on Wednesday March 23, 2016 @09:13PM (#11349821)
Oh, and one other memorable detail that I couldn't make up.

The database went down DURING the CEO's 50th birthday party!

Re:An administrator accidentally deleted the production data... by m_samuel_l on Wednesday March 23, 2016 @05:56PM (#11348589)
i love happy endings :)
Re:An administrator accidentally deleted the production data... by pkaye on Wednesday March 23, 2016 @11:03AM (#11345102)
Perhaps one of the senior guy should have learned from past mistakes but they are still in this situation?
Re:An administrator accidentally deleted the production data... by KB1JWQ on Wednesday March 23, 2016 @08:15AM (#11343704)
Ah, the good old "blameful postmortem." Sounds like a toxic culture...
Re:An administrator accidentally deleted the production data... by oolongCat on Wednesday March 23, 2016 @08:36AM (#11343830)
Now that's terrifying. Glad it worked out for you.

My tifu is when I first started working for an actual client, I thought I was a genius running my own git server on my own computer. Also I had the ssh key for my server on the same computer.

When my hdd failed, I lost everything.

Now the funny thing was, while my server was running I had no way to gain access to the server, the customer had already started using it, and they had inserted around 400-500 records already.

Now there I was, locked out of my own server, no source code I was working on for around 3-4 months.

Lucky for me, someone online had mentioned about a way to gain access to an aws server if you lost the ssh key.

I created a new instance, and mapped the old storage to the new instance. Lucky for me this worked.

Also, 2 weeks(ish) before this blunder I had sent a copy of my code to a friend who was helping me with some issues I had.

So my email saved me.

Now I backup regularly, use github(recent projects gitlab) and I have my ssh keys on 3 separate pen-drives and this http://www.oakalleyit.com/node/4 ----------------

Re:An administrator accidentally deleted the production data... by Splines on Wednesday March 23, 2016 @09:08AM (#11344029)
It's always nice to dodge a bullet, and doubly nice to know where, when and how that bullet was dodged.
Re:An administrator accidentally deleted the production data... by jamiesonbecker on Wednesday March 23, 2016 @02:54PM (#11347200)
Userify lets you instantly update/rotate your SSH key on all your boxen through its web console.

Be sure to use MFA, of course ;)

Re:An administrator accidentally deleted the production data... by jlgaddis on Wednesday March 23, 2016 @06:09PM (#11348663)
Awesome, a third-party with, effectively, administrative control over all my machines and data. What could go wrong?
Re:An administrator accidentally deleted the production data... by vacri on Wednesday March 23, 2016 @08:24PM (#11349571)
The GP is already using AWS, and successfully restored the system through AWS snapshots. In this case, that third-party with administrative control saved the day.
Re:An administrator accidentally deleted the production data... by Buttons840 on Wednesday March 23, 2016 @12:40PM (#11346011)
About your link and printing QR codes. Why not just print the key in plain text?
Re:An administrator accidentally deleted the production data... by doodpants on Wednesday March 23, 2016 @01:25PM (#11346442)
Answered in the post:

> You now have to type your ​1,675 character key in by hand! Obviously this is not only tedious, but also very error-prone. And that's where the QR code comes in handy. With a QR code, you would only need to scan the page to bring your digital copy back to life. No errors, no tedium.

Re:An administrator accidentally deleted the production data... by pingec on Wednesday March 23, 2016 @09:11AM (#11344051)
How do you scan that huge qr code?
Re:An administrator accidentally deleted the production data... by elbigbad on Wednesday March 23, 2016 @09:33AM (#11344216)
In much the same way you might scan this billboard-sized QR code located at the top of a building. Namely, by moving backward. :p

https://upload.wikimedia.org/wikipedia/commons/thumb/3/32/Ja...

Re:An administrator accidentally deleted the production data... by cmurf on Wednesday March 23, 2016 @09:56AM (#11344438)
And what's the pass fail rate?
Re:An administrator accidentally deleted the production data... by tombrossman on Wednesday March 23, 2016 @10:22AM (#11344695)
The simple 'Barcode Scanner' app on Android handles it easily. Here's a screenshot of the output: http://i.imgur.com/ELXvBqu.png

Failing that, just use an online reader and upload the PNG image of the QR code. Your pass rate should be 100%.

Re:An administrator accidentally deleted the production data... by lfam on Wednesday March 23, 2016 @12:16PM (#11345789)
That is a "dummy" key created for demonstration purposes, right?
Re:An administrator accidentally deleted the production data... by pingec on Wednesday March 23, 2016 @03:06PM (#11347291)
Thanks for letting me know. I tried with Qr Droid and it did not recognize it.
Re:An administrator accidentally deleted the production data... by technofiend on Wednesday March 23, 2016 @08:56AM (#11343956)
I first spelunked through UNIX sometime in 1985/1986; my employer decided to sell Altos UNIX systems along with their CP/M offerings. No documentation, just a running system and a password although one person hinted that man man would help.

We used it for our accounting system along with Peachtree? It turned out we didn't have good backups because the system's disk drive was dirty and misaligned. I fixed it.

The backup scripts couldn't deal with going over one floppy and failed anyway.

I learned a lot of very useful things on that system - like when I created an extra copy of etc with an unprintable character in the name (etc^?) I got to learn all about using stty to set your erase character, ls -lq to find files with unprintable names and inodes along with ls -li and find -inum to fix my errant /etc^?.

Unfortunately for my accountant I didn't learn how to make a backup span multiple volumes until some time after I also learned a very hard lesson about unix device names and wiped the system drive while trying to mkfs on a new volume to expand the system.

He ended up rekeying all our accounting data from printouts and I ended up buying him more than one lunch.

Re:An administrator accidentally deleted the production data... by lavamantis on Wednesday March 23, 2016 @10:23AM (#11344707)
"rekeying all our accounting data from printouts"

I am cringing.

Re:An administrator accidentally deleted the production data... by arethuza on Wednesday March 23, 2016 @10:41AM (#11344873)
If you think that's bad, ~12 years ago I worked on a project that was an online insurance form. The output from the application form was going to be printed out and then submitted to the existing paper-based workflow for handling applications - which involved scanning the application and then workers typing in the data from the scanned form.
Re:An administrator accidentally deleted the production data... by engi_nerd on Wednesday March 23, 2016 @12:06PM (#11345688)
Not more than 2.5 years ago I wrote a script to take the bill of materials from a CAD program and cross-reference it with a flat-file database (read: Excel spreadsheet) that contained information on how 'old' part numbers mapped to 'new' part numbers. Shame the CAD program couldn't just be scripted to do this. Anyway, the final output of this was a bill of materials that said what you'd expect: I need X quantity of Y parts, here are the part numbers for each.

This was emailed to a "warehouse" specialist, who then, I found out, printed out my BOM, then compared it to that day's (printed) inventory of parts, came up with what needed to be issued directly and what needed to be ordered, and then he manually entered that into the actual warehouse logistics system.

And lest you think I was lazy, I asked to be allowed to script all this out, too, only to be told "there is no way for us to submit anything to our logistics system that way, everything has to be entered manually."

This wasn't some no-name company, this was a major aerospace company.

Re:An administrator accidentally deleted the production data... by chris_wot on Wednesday March 23, 2016 @12:52PM (#11346145)
I managed to get employee of the quarter because the company I worked for (a major company that made inkjet printers) had been tasked to find out more about third party ink cartridges from their service system.

This company had a Pick database, and rather than extend it normally someone had the bright idea of storing each ink cartridge record in a .INI file. That's right, each record was a .INI file and the fields were stored as column=value.

To get at this data, they tasked one of their employees to open each file, copy the first field to an Excel spreadsheet, then copy the second field to the Excel spreadsheet, etc. There were something like 10,000 ini files, and it took about 6 weeks for the guy to input the data.

I was rather young and bored on the call centre helpdesk, and I had been fooling about with Linux and Perl. When I heard what he was doing, I rather naively said that this was what Perl was designed for. The guy deliberately said he didn't believe me, and I took that as a challenge so that night I went home and whipped up a Perl program that processed the ini files into a CSV file. I then installed ActiveState's Windows port of Perl and ran it over a copy of the ini files. About 5 seconds later it produced the csv file.

I told the guy to not tell anyone as I wasn't really meant to install ActiveState's program on any corporate computers. He ignored this and the next thing I know I was made employee of the quarter.

Re:An administrator accidentally deleted the production data... by noisy_boy on Wednesday March 23, 2016 @03:10PM (#11347326)
I think the highlight of this story is that the company had the culture to reward you instead of burying your achievement under policy-violation blanket.
Re:An administrator accidentally deleted the production data... by chris_wot on Wednesday March 23, 2016 @05:02PM (#11348202)
It was a tiny bit more complicated than that I'm afraid. I suspect they did it to ensure that someone else didn't get the award...
Re:An administrator accidentally deleted the production data... by protomyth on Wednesday March 23, 2016 @05:46PM (#11348536)
There are few more soul killing for a programmer to be told that "its just more cost effective to have someone type this into the other system".
Re:An administrator accidentally deleted the production data... by engi_nerd on Wednesday March 23, 2016 @11:49PM (#11350452)
Yes!

I'm not a programmer by trade. I just seem to be one of the few engineers in my tiny little specialized domain that doesn't mind writing a little bit of code now and then to solve a problem.

Re:An administrator accidentally deleted the production data... by justinclift on Wednesday March 23, 2016 @06:13PM (#11348683)
Won't be Airbus then, as their main CAD system has fairly powerful scripting bits. ;)
Re:An administrator accidentally deleted the production data... by technofiend on Wednesday March 23, 2016 @12:15PM (#11345775)
You can imagine how it felt at the time - 18 years old and I had just destroyed the accounting system for a sales-driven organization. Was convinced that was my last night at the company and had to stew in my own juices from that evening until telling my boss about it the following morning.
Re:An administrator accidentally deleted the production data... by Scarblac on Wednesday March 23, 2016 @08:46AM (#11343901)
In my first job (at a pretty small company) I needed to debug something. I made a dump of the production database, downloaded it to my dev machine, then deleted the live production database instead of the one on my dev machine by accident (typed the command in the wrong shell).

This happened while the CEO was talking to someone external to the company, right beside my desk. Little adrenalin rush there.

Anyway I had of course just made a backup, and only one order was placed while I was downloading it that I could restore by hand using the email that was also sent for each order, so no damage done. But I'll never make that mistake again :-)

Re:An administrator accidentally deleted the production data... by schlowmo on Wednesday March 23, 2016 @10:35AM (#11344808)
I think the "wrong shell incident" is quite common:

"Just need to load this dump to the testing database and I'm on my way to weekend...ok done...oh wait, if I look closer, this shell isn't the testing system...hell noooo, just nuked 8 hours of work each from 20 product managers."

Literally happend to me when I was a working student at a DAX 30 corporation. Never happend to me since then again.

Re:An administrator accidentally deleted the production data... by hollander on Wednesday March 23, 2016 @02:42PM (#11347097)
To prevent this I change the PS1 in the bash config. For servers I use a different prompt format.

For my local computer:

hollander@mypc 19:30:45 ~ >

For servers:

[hollander@server01 19:30:45 ~]

This all with coloring for name, servername, time and filepath, different for local computer and server. Root and username have different colors as well.

Re:An administrator accidentally deleted the production data... by noir_lord on Wednesday March 23, 2016 @03:49PM (#11347630)
Local's are green, staging is orange, production is bright red.

Saved me a whole bunch of times when tired.

Re:An administrator accidentally deleted the production data... by chris_wot on Wednesday March 23, 2016 @07:11PM (#11349087)
Can you paste in the shell codes you use?
Re:An administrator accidentally deleted the production data... by noir_lord on Wednesday March 23, 2016 @08:03PM (#11349449)
Red

export PS1="\[\e[31m\]\u\[\e[m\]\[\e[31m\]@\[\e[m\]\[\e[31m\]\h\[\e[m\]\[\e[31m\]:\[\e[m\]\[\e[31m\]\W\[\e[m\] "

Orange

export PS1="\[\e[33m\]\u\[\e[m\]\[\e[33m\]@\[\e[m\]\[\e[33m\]\h\[\e[m\]\[\e[33m\]:\[\e[m\]\[\e[33m\]\W\[\e[m\] "

Green

export PS1="\[\e[32m\]\u\[\e[m\]\[\e[32m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\]\[\e[32m\]:\[\e[m\]\[\e[32m\]\W\[\e[m\] "

As always you can tailor them if you prefer different things to be different colors, I'm often lazy and don't change local machines to green but always change staging to orange and production to red.

Re:An administrator accidentally deleted the production data... by eric_h on Wednesday March 23, 2016 @11:40AM (#11345427)
It's common enough that I made sure our AWS boxes put the name of the current environment both in the bash prompt and rails console prompts (production is in bright red, staging is a nice soothing purple :).
Re:An administrator accidentally deleted the production data... by RockyMcNuts on Wednesday March 23, 2016 @12:38PM (#11345990)
I actually make a terminal-window-size PNG of 'PRODUCTION' and 'TEST' and set it as the background gif at like 10% alpha in the terminal windows, which also have different background colors.
Re:An administrator accidentally deleted the production data... by twic on Wednesday March 23, 2016 @08:23PM (#11349568)
I set the background colour in our team's shared iTerm config. Green for CI, blue for the test server, yellow for staging, and we don't have access to production!
Re:An administrator accidentally deleted the production data... by eric_h on Wednesday March 23, 2016 @08:43PM (#11349678)
The thing I like about our setup is that it's completely independent of individual developers' setups. Some of us use iterm, some of us are okay with terminal.app (iterm 2 ftw!). All of the backend capable folks (three of us) do have access to production, but we use it very responsibly (helped by the white on a red background production in the console prompt)
Re:An administrator accidentally deleted the production data... by chris_wot on Wednesday March 23, 2016 @12:55PM (#11346176)
Oh boy, is it ever. I once had a Linux gateway without X installed on it, and I ssh'ed into a remote billing server. A friend called to see if I wanted to go out for lunch so I issued the shutdown -h now command.

I was trying to work out why the system wasn't responding right at the moment when I realised I hadn't logged out of the ssh session.

Re:An administrator accidentally deleted the production data... by arethuza on Wednesday March 23, 2016 @08:54AM (#11343944)
I had a developer who worked on my team at my last job make almost that exact mistake - I literally saw the blood drain from his face.

Fortunately we also had the DBAs in the same room - so HR database restored without anyone noticing. Poor chap - I think he got quite a scare.

Fun and games... :-)

Re:An administrator accidentally deleted the production data... by mclovinit on Wednesday March 23, 2016 @02:59PM (#11347244)
We were a development team years ago (90s) working late on the production Oracle database writing some SQL (cringe). One junior dev deleted all records from one of the core tables and sat expressionless in total fright for a good 5 minutes. I let her sweat for a bit before I typed 'rollback;' Good thing she didnt commit and there was enough rollback space :) One of many close calls.
Re:An administrator accidentally deleted the production data... by ownagefool on Wednesday March 23, 2016 @10:51AM (#11344980)
I did the same thing about 8 years ago but had to ask a more senior person to restore.
Re:An administrator accidentally deleted the production data... by repomies691 on Wednesday March 23, 2016 @07:30AM (#11343494)
To put these in perspective, it is not that uncommon for a years worth of work to go to waste, just for different reasons (eg. wrong assumptions, no market for the product, etc). However when you do mistakes, the process of encountering them and fixing them is much more stressful in the moment, and most of us try to avoid them as much as we can. However it might be that trying and making mistakes is more productive in longer run than avoiding risks and taking safe and calculative approach.
Re:An administrator accidentally deleted the production data... by arethuza on Wednesday March 23, 2016 @07:51AM (#11343585)
"wrong assumptions, no market for the product, etc"

Been there, done that!

However, to stick to the subject of databases - I found later in my career that the really alarming events are more to do with having data you shouldn't have rather than not having data you should.

NB The only one of these that I'm going to admit to involved a demo application being sent out on CDs to hundreds of thousands of end-users by IBM and sample data sourced from a particularly unpleasant alt.* newsgroup - I was CTO and when an engineer approached me and rather sheepishly told me that some of the same data had gone to IBM I had a very bad moment indeed.

However, on investigation it turned out the only thing that did go out on the CD was the single word "sheep".

Re:An administrator accidentally deleted the production data... by jvoorhis on Wednesday March 23, 2016 @11:51AM (#11345520)
At a startup earlier in my career, we generated an email address for every customer which they could use to interact with our system. The CEO wrote a script to pick words at random from the Princeton Wordnet database.

One afternoon I thought, wait a minute, what's actually in Wordnet?

Needless to say, many apology emails were sent later that day.

Re:An administrator accidentally deleted the production data... by cvwright on Wednesday March 23, 2016 @07:12PM (#11349100)
In recent years, I created a homework assignment for a security class where the student's job is to crack a set of password files. First easy, un-salted hashes, then salted hashes, ... etc.

To illustrate the badness of using dictionary words as a password, I randomly generated a unique password file for each user by sampling from /usr/share/dict/words.

> One afternoon I thought, wait a minute, what's actually in Wordnet?

I know exactly how you feel. It took me about 5 minutes to find Shutterstock's list of dirty, naughty, obscene, and otherwise bad words [1], and about 20 more minutes to add a blacklist check to my script.

Fortunately none of the students had actually been given a bad word. Whew!

[1] https://github.com/shutterstock/List-of-Dirty-Naughty-Obscen...

Re:An administrator accidentally deleted the production data... by aptwebapps on Wednesday March 23, 2016 @12:47PM (#11346072)
Actual two-word passphrase from an AOL disc once in my possession: 'cloaca market'.
Re:An administrator accidentally deleted the production data... by twic on Wednesday March 23, 2016 @08:27PM (#11349589)
> the really alarming events are more to do with having data you shouldn't have rather than not having data you should

the really really alarming events are more to do with your users having data they shouldn't!

Re:An administrator accidentally deleted the production data... by bottled_poe on Wednesday March 23, 2016 @07:56AM (#11343605)
Making mistakes is acceptable - catastrophic failure is a different story.
Re:An administrator accidentally deleted the production data... by spacecowboy_lon on Wednesday March 23, 2016 @08:06AM (#11343653)
Reminds me of an incident at a very large UK company where the outsourced operator manged to destroy all of the payroll tapes.

First run fails second run loads backup tape into a malfunctioning tape unit which then trashes the tape - they kept doing this for all of the backups.

This was the second month of the new out sourced payroll system replacing an in house one which had run for decades without incident.

Re:An administrator accidentally deleted the production data... by kbenson on Wednesday March 23, 2016 @11:51AM (#11345522)
> Also had someone from Oracle break a financial consolidation system for a billion dollar company - his last words were "you need to restore from tape" and then he disappeared.

Tech: "Err, boss, I just totally broke their entire system"

Manager: "That's no problem, you got them to sign that contract, right? We always pad those with more services than they have employees or customers to use, so we can use that to cover any problems."

Tech: "..."

Manager: "Johnson, I'm not hearing the confirmation I expected."

Tech: "Sorry boss, there was an issue they were keen to have me look at and... well..."

Manager: "Johnson, you get your ass back here now. Do not pass go. Do not collect $200. The phone will not accurately convey the ass-chewing you are about to receive, and you don't deserve the paltry protection it would allow." <click>

Tech looks up to see local tech liason.

Tech: "Ehm. You need to restore from backup."

Re:An administrator accidentally deleted the production data... by pc86 on Wednesday March 23, 2016 @08:39AM (#11343854)
Oracle is extremely good at coming in, completely hosing everything, then disappearing and sending you a $350/hr invoice for the privilege. Their consultants seem to tread the line between totally incompetent and actively malevolent surprisingly well.
Re:An administrator accidentally deleted the production data... by lmilcin on Wednesday March 23, 2016 @09:38AM (#11344250)
Do you have anything to back your opinion or you had just one bad experience with Oracle consultant and now generalize to tens or hundreds of thousands of cases that you have absolutely no knowledge about?

On my part I only have very positive experience with Oracle consultants, but this is only my opinion based on just a few interactions.

Re:An administrator accidentally deleted the production data... by pc86 on Wednesday March 23, 2016 @09:48AM (#11344348)
I worked for a Fortune 500 healthcare company that used both Oracle and IBM consultants extensively. I had exactly two positive experiences with Oracle consultants where they delivered as promised and maybe four or five where they delivered but took longer/went over budget/etc to the point where I feel we lost value in the long run. And maybe two dozen experiences that were as I described initially.

So in my experience somewhere between 5-8% will be worth it.

Re:An administrator accidentally deleted the production data... by rosser on Wednesday March 23, 2016 @05:36PM (#11348472)
At my last job, we used to have an Oracle-acquired storage product in a rather critical part of our stack. It was having some performance problems one night, during a peak traffic period. It may even have been Cyber Monday; I don't remember exactly.

Our then systems team lead called Oracle support, and was advised by the support rep — a third tier rep, mind you, because we had priority support, and had the call escalated when the first guy couldn't do anything — to run an on-board low-level diagnostic. He confirmed with the phone rep three separate times that running such a check would be safe to do with live, mounted filesystems, and would not adversely impact operations. He was answered in the affirmative each time.

He hit enter. The site went down. $.75mm in lost revenue over the next 8-10 hours, unfucking that pretty little mess.

Re:An administrator accidentally deleted the production data... by chris_wot on Wednesday March 23, 2016 @07:23PM (#11349189)
When in doubt, refuse and escalate. It's your systems! Especially with Oracle support, who have a particularly bad reputation.

Honestly, Oracle's reputation is mud. Ever since I saw the Oracle Chief CSO's presentation on security which used biblical parables as principles for securing environments I've been even more wary of accepting any advise on face value from any Oracle employer...

Re:An administrator accidentally deleted the production data... by mipmap04 on Wednesday March 23, 2016 @09:48AM (#11344346)
Oh man I had a project similar to this recently.

My team got hired to document this fairly large database (800+ tables, 2000+ SPs). We decided to use a product that actually writes the documentation to the DB as extended properties. The client specifically did not want us to use dev for this, so they put us in test. Immediately this raised some warning bells in my mind so I let them know that risks regarding what could happen if they move from dev to test without notifying me (if I'm notified, I can script out the extended properties and reapply them to the test after the migration is complete).

We're about 2 months in and 90% complete. One morning, ops decides to migrate to test and doesn't let me know. One of my team members logs into the system and tells me that everything has disappeared. At this point, I'm sweating bullets and I'm pretty sure that I'm going to be in some tough conference calls the next couple of days. It's a fixed fee project with a client that we have a really good relationship with and I don't want to be the one that destroys it. After about 15 minutes of pondering my demise and hoping that they back-up the test environment, I get notified from the ops team that they create back ups weekly and test monthly for all environments. Luckily for me, this was a Monday morning so we lost maybe a few hours of work.

That being said, that was a very stressful 15 minutes and taught me how important it is to:

1) Back-up every environment - storage is cheap and labor often isn't. Having to recreate work would have been way more expensive than having the systems in place to save the potential lost work. Additionally, you never know what data might be lost during testing or work done in test that you really wish you could retrieve.

2) Test your DR processes - their recovery was smooth and well executed and we had reasonable assurance it would work.

Re:An administrator accidentally deleted the production data... by lavamantis on Wednesday March 23, 2016 @10:35AM (#11344814)
Yes I think everyone has had one of those "Wanna get away?" moments. Hopefully they're very early in your career and only ever happen once. Mine was small and I was very Jr so nothing more than my pride got hurt.

The worst is when someone else notices it before you. We came in to work on Monday and some reported that they couldn't log into the system. We checked logs and noticed there were timeout errors on some SQL queries. Huh, that's odd, why is there a query "update Users set deletedat=now()" with no "where" clause running in production??? Turns out someone was in a hurry and tried to make a test pass without thinking to much about what the code was doing. Then - push right to prod on a Friday evening!

Re:An administrator accidentally deleted the production data... by mstade on Wednesday March 23, 2016 @09:21AM (#11344131)
At my first professional full-time gig as a software engineer I had to find a way of dumping data from barcode scanners, after some software written in-house was supposed to download all data, flush it to disk, then empty the scanners for re-use. Problem was that the flushing to disk part didn't work (but said it did) so all data was lost. This was for scanning attendees at conferences, so all data on attendees were seemingly lost.

It wasn't me losing the data, and I don't blame the engineer that did, but management sure didn't mind doing that. I took the heat for it by standing up to them and saying "there's a bad news/good news situation here" and refocusing their attention. Bad news was obviously the data looked lost, the good news was it's probably not overwritten so I suggested we write a very small piece of firmware that just does a memory dump – the scanners didn't have separate slots for storage, firmware etc, it was all in one place – and hope the memory is ordered such that the firmware comes first, followed by all the attendee data. It worked – the firmware was indeed written first and dumping it all revealed all attendee data in raw form. Thankfully it was more or less all ascii so it wasn't difficult to process the dump after it'd been downloaded. We had to do this with 20+ scanners since the mistake wasn't discovered right away.

I believe management later tried to resell this as a "data recovery solution" to other firms using these types of scanners – don't think they had much success though.

The engineer who lost the data at first mostly got off the hook with some blame game and a warning. It wasn't a very good working environment, and prior to losing the data the engineer had been pushing serious overtime hours without so much as a thank you because management had promised delivery without involving engineering in the discussions. A few months later that engineer and several others, including myself, quit for other jobs.

Re:An administrator accidentally deleted the production data... by Arnt on Wednesday March 23, 2016 @04:10PM (#11347793)
You'd like the system administrator at a medical research facility where I once worked. Every Monday around noon, he deleted a file, a randomly file from a randomly chosen production system, then restored that file from backup.

I've always admired that, but never emulated it...

Re:An administrator accidentally deleted the production data... by justinclift on Wednesday March 23, 2016 @06:25PM (#11348759)
Heh Heh Heh

On one contract about a decade ago, the manager used to proactively screw around with server hardware (eg pull a hdd out of a raid set) when bored, to ensure our recovery processes were always battle tested.

Didn't generally cause too many issues... until the one time he pulled a working hdd out of a raid5 set that already had a (real) failed drive, which we were already attempting to recover. It was a production database, but thankfully not a mission critical one :>.

From memory, he stopped testing things like that for a while afterwards. ;)

Re:An administrator accidentally deleted the production data... by cvwright on Wednesday March 23, 2016 @07:15PM (#11349125)
Re:An administrator accidentally deleted the production data... by justinclift on Saturday March 26, 2016 @07:32AM (#11365280)
Yeah, the similarity hasn't escaped me either. ;)
Re:An administrator accidentally deleted the production data... by matwood on Wednesday March 23, 2016 @11:45AM (#11345470)
You do not have backups until you have tested the restore. Typically, I restore the production backups to the test environment. This way test gets up to date data and the backup restores are tested.

I have so many stories of data loss from many years working, that I do nothing without backups. From fat finger deletes to raid card batteries failing to multiple disks in the raid array failing at the same time. Data will be lost at some time with the only recovery method being a backup.

Re:An administrator accidentally deleted the production data... by mikehollinger on Wednesday March 23, 2016 @09:13AM (#11344071)
Yep. I interned at my high school over the summer back in the late 90's and (aside from ghosting pcs or helping with Windows login stuff) also managed the tapes for our main server. The underling in the it shop, one afternoon, was showing me something and to prove a point about RAID, pulled one of the drives from the servers raid array, then plugged it in again. It was magic!

Fast forward a month. I do the same thing when talking to someone. The next day, the sever is offline. I either pulled the wrong drive, the array was degraded, or some actual failure occurred overnight. I'll never know.

I did, however, learn that day about how veritas backups work, and to always know wtf I'm doing before showing off. :-)

Re:An administrator accidentally deleted the production data... by fallinghawks on Wednesday March 23, 2016 @12:27PM (#11345888)
Same deal here, we'd been backing up the servers to tape and dutifully boxing and taking one set offsite. Finally someone deleted something by accident and that's when I discovered you should verify that you can read the tape once in a while. Fortunately, not an important document, but that was just luck.
Re:An administrator accidentally deleted the production data... by greggman on Wednesday March 23, 2016 @05:53PM (#11348570)
typed

    del c:\*.*
instead of what I meant

    dir c:\*.*
On my bosses PC right in front of him. Fortunately someone had a copy of norton tools back then (~1987)
Re:An administrator accidentally deleted the production data... by fit2rule on Wednesday March 23, 2016 @09:50AM (#11344372)
Seen this from a different angle: watched a rookie admin delete the only copy of the soon-to-be-production database, which was the result of a year of data-mangling/massaging before it could be put online for production .. saw him do the delete, nothing I could about it in time.

Spent a week recovering the data, a block at a time .. learned enough about the database filesystem to write an 'un-delete' tool, sold it after using it to successfully recover the original project, and have never looked back ..