last day (15 days later) » 

14:03
38
Q: If I mistakenly delete some data from production environment

Jude NiroshanI am a junior developer, still not confirmed in my workplace. I am dealing with very sensitive, unrecoverable data in our production environment. A lot of workload is on me for different tasks in our live environment. If I mistakenly deleted some valuable data, what am I supposed to do? I manuall...

Just restore it from the backup. They do backups, right?
Yes. But the backup data is normally take for some long period of time. About once per week. In my case, the data i am dealing with is can be changed during that period. In that case, replying on backups is not guaranteed.
Don't they back updatawhere you come from? Aside from that, I don't answer hypothetical questions. Did you or didn't you delete the data?
Are you talking about running sql scripts, or data loss as a result of deploying buggy code?
yes.basically i manually(using sql scripts) move some in the database here and there.
14:03
Please edit your question to clarify whether you actually did delete data and are looking for damage control after the fact - or whether you want to proactively make sure to limit damage in case something happens.
@StephanKolassa for me, it's pretty clear this is an hypotetical question, but since many people aren't sure, then yes a clarification would help.
I'd simply ask why this task has to be performed the way it is. Bottom line is that no developer should be in a production environment making these kinds of changes. If the process is absolutely necessary than it should be automated to reduce risk and safeguards should be put in place to prevent the accidental deletion of mission critical data. The whole practice is questionable, the fact that a junior member is responsible for the task raises a major red flag.
The fact they are letting you (junior dev) use SQL scripts to move data around in a production environment is troublesome. These scripts should be developed, tested in a DEV and QA environments and then approved. I would bring this up to a Senior dev so you can come up with mitigation plans. If the anwer looks or sounds anything like: "We don't have time" or "Just be really careful", then the company has bigger problems.
This happen to someone at one of my work. He didn't hesitate one second and ran to the guys that could restore the information. Then ran to his superior explaining the problem. 1- He knew who to talk to. 2- He didn't hesitate. 3- He took responsibility. Because of his quick action, everything was restored in a matter of minute with no loss.
Is this question time sensitive?
14:03
@TheMathemagician: Don't be a monster. This junior developer is one step away of losing his job.
Really good answers here for both the hypothetical case and the actual.
"...I cannot handle any risky work at all..." If you think this is true, then sure, convey it out?
I was once at work until 11 PM recovering data a junior DBA accidently deleted ("I had prod open in one window and dev in the other and ran the script on the wrong one"). Backups weren't current but fortunately I could mine what he'd dropped from some precached web pages. Stuff happens, they didn't fire him.
Since you see yourself as inexperienced, are you sure these data changes are unrecoverable? Maybe you need to ask what to do just in case.
These are questions to ask your team lead or manager not the intewebs
14:03
@Jude You have dozens of comments and answers. Please edit your question and update with the answers you are being asked in the comments
Adding to other answers - Step 1: Take a deep breath and let it out slowly. I don't know how seriously your company is going to respond to this, but accidentally executing your very first "DELETE FROM dbo.CreditCards" is pretty much a rite of passage for junior developers! In the absolute worst case scenario, if I was interviewing you for your next job and I found out about this my first thought would be "how stupid would the company have to be to both not have a recovery plan AND to let a junior developer near such high-risk data".

last day (15 days later) »