Complete AI Training
Sign inGet my AI kit

Your job's AI kit

Get your AI kit

Tell us who you are and what you do. We show you your kit right away and email you the link: skills, prompts, AI agents, MCP servers and courses for your job.

500+ jobs ready, and we make a kit for any other job. No payment needed to look.

Share

AI agent for database administrators

Orphan Database and Schema Cleanup Agent

Unused databases retired safely with a tested backup, and owners confirmed for everything that stays

Orphan Database and Schema Cleanup Agent: what goes in, what the agent does and what you get

What it does

Over the years, copies of production and test schemas pile up, and nobody dares drop them. This agent lists databases and schemas across environments, then reads the last connection time, owner, size and backup status for each. It sorts them into likely active, likely abandoned and unknown. For the last two groups it asks the likely owners to claim or release them, and tracks replies. For items nobody claims, it drafts a retire plan: final backup, restore test to prove the backup works, and a waiting period before the drop. The DBA approves each drop. Edge case: a schema with no connections for a year but used by a yearly finance close is spotted from last year's log and kept.

How it works

Follow the arrows from top to bottom. The orange dashed arrow is the loop: when a check fails, the agent goes back and tries again.

Start and resultWhat it doesA check on its own workWaits for your OKGoes back and retries
Yes, continueYes, continueApprovedNoNo 1 STARTS WHEN Monthly inventory scan 2 USES A TOOL List databases and schemas with last connection,size and owner 3 DOES Sort into active, likely abandoned and unknown 4 USES A TOOL Check yearly or seasonal use in older logs 5 USES A TOOL Ask likely owners to claim or release each item 6 CHECKS THE RESULT Did an owner reply within 14 days? If not: ask the owner's manager and add a secondreminder. Back to step 4. 7 DOES Draft a retire plan with final backup and restoretest 8 USES A TOOL Take the backup and run a restore test 9 CHECKS THE RESULT Did the restore test pass? If not: retake the backup and test again, otherwise keepthe database. Back to step 8. 10 YOU APPROVE DBA approves each drop after the waiting period 11 RESULT Cleanup report and storage freed
Read the steps as a list
  1. Monthly inventory scan
  2. List databases and schemas with last connection, size and owner
  3. Sort into active, likely abandoned and unknown
  4. Check yearly or seasonal use in older logs
  5. Ask likely owners to claim or release each item
  6. Did an owner reply within 14 days?If not: ask the owner's manager and add a second reminder. Back to step 4.
  7. Draft a retire plan with final backup and restore test
  8. Take the backup and run a restore test
  9. Did the restore test pass?If not: retake the backup and test again, otherwise keep the database. Back to step 8.
  10. DBA approves each drop after the waiting periodThe agent waits here for your OK.
  11. Cleanup report and storage freed

How it decides

A database is a candidate when it has no connections for 180 days and no owner claim. A drop needs a successful restore test first.

  • Candidate after 180 days without connections
  • Look back 13 months for yearly workloads
  • Wait 30 days after owner notice before any drop
  • Never drop an item without a passing restore test

Make it yours

Every agent is a starting point. You choose these settings for your own situation.

  • Inactivity days (default 180)
  • Waiting period after notice (default 30 days)
  • Environments in scope
  • Owner reply deadline (default 14 days)

What keeps you in control

It always asks you first

  • Each drop
  • Extending the waiting period

Hard limits

  • Never drops anything itself
  • Never contacts anyone outside the company

It stops when

  • Done: all candidates dropped, kept or owned
  • Stop: restore tests fail twice

Set it up

We guide you through the set-up, step by step

Members get the full set-up guide for this agent. No technical skills needed: you copy, paste and upload.

10 minto set it up in your AI
5 AIsChatGPT, Claude, Copilot, Gemini, Grok
  • One set of instructions to paste into your AI, with the clicks for ChatGPT, Claude, Microsoft 365 Copilot, Gemini and Grok
  • The agent then walks you through connecting your own data, one source at a time
  • A downloadable copy with the flow chart, the rules and the full guide
Get access to this agent

An example run

What happensThe scan found 212 databases. 41 had no connection for 180 days and 9 had no owner. Owners claimed 22 and released 11. For 8 unclaimed items the agent took backups. One restore test failed on a corrupt file, so the agent took a fresh backup, and the retest passed. After 30 days the DBA approved 8 drops and freed 1.3 TB.

More agents for database administrators