Audit database
audit_databaseRun a comprehensive database performance and health audit on a PostgreSQL schema. Returns health status, top issues, and recommendations based on memory, locks, and logs analysis.
Instructions
Run a deep, comprehensive DBA-level database performance, logs, and health audit over the specified schema. Scans memory, checkpoints, temp file spills, contention locks, dead tuple cleanliness, and optionally scans custom logging tables. Returns an object with timestamp, database, version, overall_health ('GOOD' / 'WARNING' / 'CRITICAL'), health_score (int), categories (per-area results), top_issues, recommendations, and raw_stats_snapshot.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | Yes | ||
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. | |
| log_table | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| version | Yes | ||
| database | Yes | ||
| timestamp | Yes | ||
| categories | Yes | ||
| top_issues | Yes | ||
| health_score | Yes | ||
| overall_health | Yes | ||
| recommendations | Yes | ||
| raw_stats_snapshot | Yes |