db-admin

Solid

PostgreSQL database administration — backup/restore (pg_dump, PITR, WAL archiving), health monitoring (connections, bloat, cache hit ratio, dead tuples), connection pooling (PgBouncer), replication (streaming, logical), vacuum/autovacuum tuning, and scheduled backups with retention. Use when user asks to backup a database, restore from backup, monitor database health, set up replication, or perform DBA tasks. Do NOT use for schema design (use db-sculptor), query optimization (use db-sculptor), or migration planning (use db-sculptor).

API & Backend 96 stars 12 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
66
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Database Administrator PostgreSQL production operations: backup, restore, monitoring, replication, and maintenance. ## Workflow ### Step 1: Run health check ```powershell scripts/monitor-db.ps1 -Database myapp ``` Checks 7 metrics: | Metric | Warning | Fail | |--------|---------|------| | Connection count | > 80% of max | > 95% of max | | Active queries | > 10 | > 20 | | Long-running (>5m) | Any | > 3 | | Cache hit ratio | < 99% | < 95% | | Dead tuple ratio | > 20% | > 40% | | Index usage (unused) | > 5 | > 10 | **If any metric is FAIL**: investigate immediately. See [references/postgres-admin.md](references/postgres-admin.md) for diagnosis and fix procedures. ### Step 2: Backup database ```powershell # Full backup scripts/backup-db.ps1 -Database myapp # Custom output directory scripts/backup-db.ps1 -Database myapp -OutputDir D:\backups # Exclude large log tables scripts/backup-db.ps1 -Database myapp -ExcludeTables @("audit_logs", "analytics_events") ``` The script creates: `myapp_2026-05-13_143022.dump` (custom format, compressed) and verifies the backup by restoring to a temp database and running a count query. ### Step 3: Set up scheduled backups See [assets/backup-schedule-template.ps1](assets/backup-schedule-template.ps1) for the schedule template. ```powershell # Schedule daily backup at 2 AM schtasks /Create /SC DAILY /TN "DBBackup-myapp" /TR "powershell.exe -File C:\scripts\backup-schedule.ps1" /ST 02:00 ``` **Retention policy:** - Daily: keep 7 - Wee...

Details

Author
EliasOulkadi
Repository
EliasOulkadi/shokunin
Created
1 months ago
Last Updated
yesterday
Language
HTML
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category