Skip to content
RED SAGSkills
hardDatabase Administrator interview question

Someone ran DELETE without a WHERE clause on an important production table 20 minutes ago. What do you do?

What the interviewer wants to hear

  • Stay calm, stop further damage, and communicate
  • Replication already copied the delete, so replicas do not help (unless delayed replica)
  • Restore a copy to a separate server with PITR to just before the delete
  • Extract missing rows and merge them back carefully
  • Avoid overwriting newer good data; verify
  • Postmortem: permissions, safeguards, delayed replica

Model answer

First I tell the incident channel and stop the damage, for example by pausing jobs that depend on that table. Normal replicas already applied the DELETE, so they do not help, unless we have a delayed replica, which would be the fastest source. Otherwise I restore the latest base backup to a separate server and use point-in-time recovery to replay WAL or binlog up to just before the DELETE. I find the exact time from logs or, in MySQL, by reading the binlog with mysqlbinlog. I do not restore over production, because that would lose 20 minutes of other good writes. Instead I export the deleted rows from the recovered copy and insert them back, checking foreign keys and conflicts. After that, a blameless postmortem: remove direct write access, require reviewed changes, and consider a delayed replica.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard Database Administrator questions