All jobs / Database administrator / Automation
Database administrator interview question · 5+ years
How do your maintenance and backup jobs authenticate to the databases, without a password sitting in a script?
The strongest answer
A managed identity where the platform offers one, otherwise a service account whose secret lives in a secret store and is fetched at run time — scoped to that job, and rotated automatically
Why it works
Exactly — no human-held secret in the path, least privilege per job, and a rotation nobody has to remember.
What a good answer covers
- No secrets in scripts.
- Managed identity where possible.
- One scoped account per job.
- Rotate automatically; audit use.
Answers that fall short
- Close, but not the strongest: A dedicated service account per job, with its password in a protected configuration file on the server
Better than a literal in the script, and per-job is right; a protected file still has to be rotated by hand on every server. - Weak: The jobs run as the database service account, which already has every right they could need
Running everything as the most privileged account means a bug in one job can do anything, and the audit trail says nothing useful. - Red flag: One admin account shared by all the automation, with the password kept in the team’s password manager
A shared account cannot be scoped, cannot be attributed to anyone, and cannot be rotated without breaking every job at once.
Who gets asked this
More Automation questions
- Two hundred database servers need the same configuration change, and you are writing a PowerShell script to…
- 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?