All jobs / Database administrator / Automation
Database administrator interview question · 5+ years
Two hundred database servers need the same configuration change, and you are writing a PowerShell script to do it.
How do you script it so that it is safe?
The strongest answer
Idempotent, driven by one inventory, with a report-only mode showing what would change; then roll out in waves with a check between them, log per server, and keep a way to stop
Why it works
Exactly — a dry run plus waves means a mistake costs you five servers instead of two hundred.
What a good answer covers
- One inventory, one script.
- Report-only mode first.
- Roll out in waves.
- Log per server; keep a way back.
Answers that fall short
- Close, but not the strongest: I write the script, test it on a few servers, then run it across the rest in parallel
Testing first is right; running the remainder in one pass leaves no chance to notice a pattern of failures. - Weak: I would connect to each server and run it there, so I can watch every one of them
Two hundred manual sessions is days of work and inconsistent results — that is the problem automation exists to solve. - Red flag: I would run it against everything at once outside business hours — it is a small change
Small changes are exactly the ones applied everywhere at once, and out of hours means fewer people around to notice.
Who gets asked this
More Automation questions
- You inherit a fleet where each DBA keeps their own scripts on their own jump box, and the checks differ from…
- You are writing a small shell script that takes a backup on a Linux database server. What must it do besides…
- What do you put into a SQL script before it is allowed to run against production?
- The nightly maintenance job has not run for three weeks. Nobody noticed, because the dashboard only shows…
- What does it take to make a maintenance script safe to run twice, and why insist on it?
- How do your maintenance and backup jobs authenticate to the databases, without a password sitting in a script?