Database woes...
A long(ish) time ago, in the late 90s/early 00s I was working for a company where I had spent a fair few years doing coding on a PC based Retail Point of Sale system.
We also provided servicedesk services for a variety of retail chains in the UK and used a fairly low-to-mid-range system, called Heat, to log calls for all the different customers.
I was given the task of seeing if we could make it multi-tenant so that calls could be easily logged and managed for each customer using categories, SLAs, and stuff like that tailored for each customer and to make it easy to switch between different customers within the system when taking calls.
After a bit of time playing with the out of the box customisation options, which were mostly around tweaking fields on forms and setting-up system wide categories,SLAs,escalation routes, I ended-up implementing a whole load of functionality using triggers and stored procedures on the back end database, which was SQL Server 7.0.
I had never even clapped eyes on SQL Server before this - The PoS system I had worked on used a flat file back end database and I had no SQL Server training (of course!) so I pretty much learned on the hoof and had no support from the people who had originally installed the system.
To cut a long story short, I accidentally truncated the core call reference table that everything else hung off pretty much at the busiest time of the day! There were no Pk/Fk relationships within the database to stop that happening - all the relationships were handled within the software itself.
I couldn't just restore the database without kicking everyone out of the system and causing a fair amount of TITSUP* so, after about 30 seconds of wild panic, I ended up restoring to another database everything up to the last transaction log backup, which I had thankfully enabled a couple of weeks previously after discovering the woeful backup strategy that had been left by the original installers, and copied the restored data back over to the live database.
All done in 15 minutes flat! Hardly anyone even noticed there had been a problem and I found a dark corner to go and recover my sanity!
Needless to say, I was much more careful about using the truncate command after that....
On the plus side, I moved to a better paid DBA job in the finance sector a year or so later off the back of that project!
* Total Inability To Support Usual PoSProblems