Re: And ideally
Kind of funny story....
So I had a job where we'd run these developer written scripts against the database of users, on either the live or test system.
This was requested by a team who weren't in anyway computer literate; 'Billing'.
With a million or so customer records and these scripts doing the craziest things they could take anything from 5 minutes to a few days to run depending on which one was requested. I recall that on my first or second day my boss made some vague thing about 'never, ever run the wrong script against the wrong database'. Having come from a role where everything was rigorously controlled I pondered to myself 'how is that even possible?' - how little I knew.
Long story short I ended up doing exactly that, running the test script against the live customer database - the cause was tiredness and I had requested time off to recover - I didn't realise at the time I was suffering from very severe sleep apnea and it was seriously affecting all my judgement. I instantly realised my mistake at the time, reported it and the result was being let go from the company.
The amusing (to me) part of all this was, apart from no customers actually being affected, that I was in the process of building a system with all sorts of controls so that you couldn't call the wrong script against the wrong db; with validation of which scripts would run against the live system, etc.
I don't know if that ever got finished, I'm doubtful.