Agent skill

Managing Database Recovery

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Process use when you need to work with database operations. An agent skill from jeremylongshore/tons-of-skills-marketplace.

MITAuto-check passedDatabases

Install Managing Database Recovery

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-database-recovery -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace managing-database-recovery --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/managing-database-recovery .claude/skills/managing-database-recovery && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
managing-database-recovery
GitHub stars
2.8k
Token cost
~1.8k tokens
SKILL.md length
832 words
Files
8 (incl. scripts, references, assets)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Process use when you need to work with database operations. An agent skill from jeremylongshore/tons-of-skills-marketplace.

  • Works in 10 steps: Assess the current backup situation by… → Define RPO and RTO targets based on… → Configure WAL archiving for PostgreSQL… → …
  • You need to work with database operations
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 3 more sections
  • Runs Shell scripts from its folder; calls aws and pg_dump

What it does

Managing Database Recovery is an agent skill from jeremylongshore/tons-of-skills-marketplace. Process use when you need to work with database operations. This skill provides database management and optimization with comprehensive guidance and automation. Trigger with phrases like "manage database", "optimize database", or "configure database".

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files, including scripts, reference files and assets (for example `assets/README.md`, `references/README.md` and `scripts/README.md`). Compatibility notes: Designed for Claude Code

It sits in Databases, covering Database administration and Backup and disaster recovery. It works with PostgreSQL and MySQL. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • You need to work with database operations
  • With phrases like manage database
  • Optimize database
  • Configure database

Example prompts

  • “manage database”
  • “optimize database”
  • “configure database”
  • “/managing-database-recovery”

Requirements

  • A Bash shell
  • Docker
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Glob, Bash(tar:*), Bash(rsync:*), Bash(aws:s3:*)

Workflow steps

10 steps, taken from the first numbered list in SKILL.md.

  1. Assess the current backup situation by checking existing backup configurations. For PostgreSQL: verify archive_mode, archive_command, and…
  2. Define RPO and RTO targets based on business requirements
  3. Configure WAL archiving for PostgreSQL PITR
  4. Create a full physical backup using pg_basebackup -D /backups/base -Ft -z -P (PostgreSQL) or xtrabackup --backup…
  5. Create logical backups for portability and selective restoration: pg_dump -Fc -f database.dump dbname (PostgreSQL) or mysqldump…
  6. Upload backups to remote storage for disaster recovery: aws s3 cp /backups/base.tar.gz s3://backup-bucket/postgres/$(date +%Y%m%d)/ with…
  7. Test recovery by restoring to a separate server or container
  8. Automate backup verification with a daily cron job that: takes backup, restores to a test instance, runs integrity checks…
  9. Document the recovery runbook with exact commands for each recovery scenario: full database restore, PITR to a specific timestamp, single…
  10. Schedule monthly disaster recovery drills to verify the runbook works and the team can execute recovery within RTO targets.

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Glob
    • Bash(tar:*)
    • Bash(rsync:*)
    • Bash(aws:s3:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 5 files in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • aws
    • pg_dump

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • postgresql.org
    • pgbackrest.org
    • github.com
    • docs.percona.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Managing Database Recovery loads about 1.8k tokens when it runs, and up to ~1.8k if it reads all its reference files. Until then it costs about 70 tokens; SKILL.md has 832 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~70
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 832 words, ~1,818 tokens.

Download SKILL.mdSave it as .claude/skills/managing-database-recovery/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
managing-database-recovery
description
Process use when you need to work with database operations. This skill provides database management and optimization with comprehensive guidance and automation. Trigger with phrases like "manage database", "optimize database", or "configure database".
allowed-tools
Read, Write, Edit, Grep, Glob, Bash(tar:*), Bash(rsync:*), Bash(aws:s3:*)
compatibility
Designed for Claude Code
version
1.26.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
database, database-recovery

Database Recovery Manager

Overview

Plan and execute database backup and recovery procedures for PostgreSQL and MySQL, including point-in-time recovery (PITR), logical and physical backups, WAL archiving, and disaster recovery testing. This skill covers the full backup lifecycle from configuration through automated verification, ensuring Recovery Point Objective (RPO) and Recovery Time Objective (RTO) targets are met.

Prerequisites

  • Database superuser or replication-role credentials
  • Backup storage destination (local disk, NFS mount, S3, GCS, or Azure Blob)
  • pg_basebackup, pg_dump, pg_restore (PostgreSQL) or mysqldump, xtrabackup (MySQL)
  • tar, rsync, or aws s3 CLI for backup transfer and storage
  • WAL archiving configured for PITR (PostgreSQL: archive_mode = on, archive_command)
  • Sufficient storage for backup retention (estimate 2-3x database size for full + incremental)

Instructions

  1. Assess the current backup situation by checking existing backup configurations. For PostgreSQL: verify archive_mode, archive_command, and wal_level in postgresql.conf. For MySQL: check if binary logging is enabled with SHOW VARIABLES LIKE 'log_bin'.

  2. Define RPO and RTO targets based on business requirements:

    • RPO (acceptable data loss): determines backup frequency and WAL archiving interval
    • RTO (acceptable downtime): determines backup type and recovery procedure complexity
    • Typical targets: RPO < 1 hour (WAL archiving), RTO < 30 minutes (physical backup restore)
  3. Configure WAL archiving for PostgreSQL PITR:

    • Set wal_level = replica and archive_mode = on
    • Configure archive_command = 'test ! -f /archive/%f && cp %p /archive/%f' (or use pgBackRest/WAL-G for S3)
    • Verify archiving works: SELECT * FROM pg_stat_archiver
    • For MySQL, enable binary logging: log_bin = mysql-bin, binlog_format = ROW
  4. Create a full physical backup using pg_basebackup -D /backups/base -Ft -z -P (PostgreSQL) or xtrabackup --backup --target-dir=/backups/full (MySQL). Physical backups are faster to restore than logical backups for databases larger than 10GB.

  5. Create logical backups for portability and selective restoration: pg_dump -Fc -f database.dump dbname (PostgreSQL) or mysqldump --single-transaction --routines --triggers dbname > database.sql (MySQL).

  6. Upload backups to remote storage for disaster recovery: aws s3 cp /backups/base.tar.gz s3://backup-bucket/postgres/$(date +%Y%m%d)/ with server-side encryption enabled. Implement a retention policy (e.g., daily backups for 30 days, weekly for 90 days, monthly for 1 year).

  7. Test recovery by restoring to a separate server or container:

    • Restore physical backup: pg_restore -d testdb database.dump or untar base backup and start PostgreSQL
    • For PITR: restore base backup, copy WAL files to pg_wal, create recovery.signal with recovery_target_time = '2024-01-15 14:30:00'
    • Verify data integrity by running application test suite against restored database
    • Measure actual recovery time to validate RTO target
  8. Automate backup verification with a daily cron job that: takes backup, restores to a test instance, runs integrity checks (pg_catalog.pg_class row counts, checksum verification), and sends a success/failure notification.

  9. Document the recovery runbook with exact commands for each recovery scenario: full database restore, PITR to a specific timestamp, single table restore, and cross-region failover.

  10. Schedule monthly disaster recovery drills to verify the runbook works and the team can execute recovery within RTO targets.

Output

  • Backup configuration files for PostgreSQL (postgresql.conf changes, archive_command) or MySQL (my.cnf changes)
  • Backup scripts (shell) for automated full and incremental backups with S3/GCS upload
  • Recovery runbook with step-by-step commands for each recovery scenario
  • Backup verification scripts that automate restore-and-check procedures
  • Retention policy configuration with automated cleanup of old backups
Show full SKILL.md (321 more words)Show less

Error Handling

ErrorCauseSolution
WAL segment not found during PITRGap in WAL archiving due to archive_command failureCheck pg_stat_archiver for last_failed_wal; fix archive_command; consider WAL-G or pgBackRest for reliable archiving
pg_basebackup fails with "replication connection" errorMissing replication permissions or max_wal_senders exhaustedGrant REPLICATION role; increase max_wal_senders; add entry to pg_hba.conf for replication connections
Backup storage fullRetention policy not enforced or backup size grew unexpectedlyImplement automated cleanup script; compress backups with gzip or zstd; monitor storage usage with alerts at 80%
Recovery takes longer than RTO targetDatabase grew since RTO was last validated, or restore is I/O-boundUse physical backups instead of logical; restore to SSD storage; parallelize restore with pg_restore -j 4; consider standby replica for faster failover
Restored database has corruptionBackup taken during crash or disk errorEnable data_checksums in PostgreSQL; verify backups with pg_verifybackup; run ANALYZE and REINDEX after restore

Examples

Point-in-time recovery after accidental table drop: At 14:30 a developer runs DROP TABLE orders on production. Recovery: restore the most recent physical backup (taken at 02:00), replay WAL files up to 14:29:59 using recovery_target_time, verify orders table is intact, then swap the recovered database into production. Total recovery time: 25 minutes for a 200GB database.

Automated daily backup to S3 with verification: A cron job runs at 02:00 UTC: takes pg_basebackup, compresses with zstd, uploads to S3 with server-side encryption, restores to a Docker container, runs row count checks against production, and sends a Slack notification with backup size and verification status.

Cross-region disaster recovery drill: Monthly exercise: restore the latest S3 backup to a different AWS region, replay WAL files to catch up, run the application test suite, measure total failover time, and document results. Target: full recovery in a different region within 1 hour.

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts, references, assets) in skills/.curated/managing-database-recovery of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • assets/README.md
  • references/README.md
  • scripts/README.md
  • scripts/failover.sh
  • scripts/pitr_restore.sh
  • scripts/test_recovery.sh
  • scripts/validate_backup.sh

Open the folder on GitHubat commit cfae287

Compare with similar skills

Managing Database Recovery next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Managing Database Recovery compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Managing Database Recovery this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.8kAutomated safety check: PassMIT
Database Backupssickn33/agentic-awesome-skills47k2 repos~3.1kAutomated safety check: NotesMIT
DB Ops SopOpenDCAI/DataMind451—~388Automated safety check: PassApache-2.0
Database Expertcin12211/orca-q224—~2.8kAutomated safety check: PassMIT
DB AdminEliasOulkadi/shokunin114—~2kAutomated safety check: NotesMIT
Database OptimizerJeffallan/claude-skills12k—~1.6kAutomated safety check: PassMIT

Similar skills

  • Database Backups

    sickn33/agentic-awesome-skills

    Implement database backup strategies. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~3.1k tokens
    DatabasesAuto-check: notes
  • DB Ops Sop

    OpenDCAI/DataMind

    Database operations runbook — backup, recovery, performance tuning, troubleshooting.

    451 GitHub stars~388 tokensUpdated 21 days ago
    DatabasesAuto-check passed
  • Database Expert

    cin12211/orca-q

    Database performance optimization, schema design, query analysis, and connection management across PostgreSQL, MySQL, MongoDB, and SQLite with ORM integration.

    224 GitHub stars~2.8k tokensUpdated 19 days ago
    DatabasesAuto-check passed
  • DB Admin

    EliasOulkadi/shokunin

    PostgreSQL database administration — backup/restore (pgdump, PITR, WAL archiving), health monitoring (connections, bloat, cache hit ratio, dead tuples), connection pooling (PgBouncer), replication…

    114 GitHub stars~2k tokensUpdated 6 days ago
    DatabasesAuto-check: notes
  • Database Optimizer

    Jeffallan/claude-skills

    Tunes PostgreSQL and MySQL performance by analyzing slow queries and execution plans, designing indexes, rewriting queries and adjusting configuration, one validated change at a time.

    12k GitHub stars~1.6k tokensUpdated 7 days ago
    DatabasesAuto-check passed
  • Whodb

    xiaoyuge886/aigc

    Database operations including querying, schema exploration, and data analysis.

    198 GitHub stars~894 tokensUpdated 2 mo ago
    DatabasesAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Managing Database Recovery

What does Managing Database Recovery do?

Process use when you need to work with database operations. An agent skill from jeremylongshore/tons-of-skills-marketplace. Managing Database Recovery is an agent skill from jeremylongshore/tons-of-skills-marketplace. Process use when you need to work with database operations.

When should I use Managing Database Recovery?

Managing Database Recovery fits situations like: you need to work with database operations; with phrases like manage database; optimize database; configure database.

How do I install Managing Database Recovery in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-database-recovery -a claude-code`. Or copy the skill folder (skills/.curated/managing-database-recovery in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/managing-database-recovery in your project. Claude Code loads it when a task matches its description.

How do I install Managing Database Recovery in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-database-recovery -a codex`. Or copy the skill folder (skills/.curated/managing-database-recovery in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/managing-database-recovery in your project. Codex loads it when a task matches its description.

Can I use Managing Database Recovery in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-database-recovery -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/managing-database-recovery, .gemini/skills/managing-database-recovery, .github/skills/managing-database-recovery and .opencode/skills/managing-database-recovery in your project.

What does Managing Database Recovery need to run?

Going by SKILL.md and its folder, Managing Database Recovery needs a shell for the scripts in its folder and the command-line tools its instructions call (aws and pg_dump). Our summary lists: A Bash shell; Docker. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(tar:*), Bash(rsync:*), Bash(aws:s3:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Managing Database Recovery access the network?

SKILL.md names 4 domains. As links in the text: postgresql.org, pgbackrest.org, github.com and docs.percona.com. This is read from the text; nothing was executed.

Is Managing Database Recovery safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Managing Database Recovery use?

Managing Database Recovery is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Managing Database Recovery use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 17 tokens, read only when the agent opens those files.

What are the alternatives to Managing Database Recovery?

Skills that share tags, products or a category with Managing Database Recovery: Database Backups (sickn33/agentic-awesome-skills, 47k stars), DB Ops Sop (OpenDCAI/DataMind, 451 stars), Database Expert (cin12211/orca-q, 224 stars) and DB Admin (EliasOulkadi/shokunin, 114 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Managing Database Recovery?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.