Runbook: Database Recovery
First response
- Stop destructive jobs and manual scripts.
- Identify affected tables and time window.
- Export current state before attempting repair.
- Restore to a staging database first.
- Validate entity counts, foreign keys and key user journeys.
- Promote the recovery plan to production only after review.
High-risk tables
- Attendance records
- Student and assistant identity tables
- Subject enrollment junctions
- Score sheets, cells and versions
- Audit logs
Validation queries
Keep a project-specific SQL notebook with count checks, orphan checks and uniqueness checks for each domain.