Monitoring tells you a database is slow right now. A health check answers a different question: is this server configured, indexed, backed up, and sized the way it should be, and what will hurt next quarter? Teams ask it after an incident, before a migration, or when they inherit a database. You do not need a commercial product for a first pass. MySQL, PostgreSQL, SQL Server, MongoDB, and Amazon RDS each have free tools that read the configuration, schema, and workload statistics and print findings you can act on. Below: the point-in-time tools, one command each, what each checks, and its licence.
- A health check covers configuration, durability, backups, replication, indexes, query workload, capacity, security, and version support. No single tool covers all nine, so combine two or three per engine.
- MySQL: Percona Toolkit 3.7.2 (
pt-mysql-summary,pt-variable-advisor,pt-duplicate-key-checker), MySQLTuner 2.9.4, and the built-insysschema. - PostgreSQL:
pg_stat_statementsfor workload, pgBadger 13.3 for logs,check_postgresfor threshold checks, andpg_activityfor a live session view. - SQL Server: the First Responder Kit (
sp_Blitz,sp_BlitzIndex, MIT licence) and Glenn Berry's diagnostic queries. MongoDB:mongostat,mongotop, andserverStatus. RDS: the free Recommendations page. - Run statistics-based checks only after the server has carried a representative workload; MySQLTuner asks for at least 24 hours of uptime.
Scope and review date: November 2026. This post covers MySQL 8.4 and 9.7, current PostgreSQL releases (the documentation is now at PostgreSQL 19), supported SQL Server versions, MongoDB 8.x and 9.0, and Amazon RDS. Tool versions, licences, and commands were checked against each project's documentation or repository on 25 November 2026. The commands were not run in a lab for this post, so try them on a staging copy first. The list is grouped by engine, not ranked.
What should a database health check cover?
A health check is a snapshot with a written result. It should end with a list of findings, each with a severity, the evidence, and a fix. Whatever tools you use, the report should answer these nine questions.
- Configuration: are memory, connection, and log settings sized for this host and workload, and do they differ from the vendor defaults for a reason?
- Durability: can a crash lose committed transactions? On MySQL that means
innodb_flush_log_at_trx_commitandsync_binlog; on PostgreSQL,synchronous_commitandfsync. - Backups and recovery: do backups exist, are they inside the retention you need, and when was a restore last tested?
- Replication and failover: is replication running, how far behind is it, and are replicas read-only?
- Indexes and schema: duplicate, unused, and missing indexes, tables without primary keys, and bloat.
- Query workload: which statements use the most total time, and which ones scan whole tables.
- Capacity: disk growth, connection headroom, cache hit ratios, and transaction ID age on PostgreSQL.
- Security: accounts without passwords, anonymous users, wide grants, and unencrypted storage or connections.
- Version support: is the major version still supported, and is the minor version current?
Tools help least with items 3 and 4: a tool can see that backups are off, but only a restore test shows a backup works.
Health check or monitoring?
Switch tabs to see how the two jobs differ on the same questions
Health check
| Question | Health check |
|---|---|
| What it answers | Is the server set up correctly, and what will fail next? |
| When it runs | On demand: quarterly, before a change, or after an incident |
| Output | A written report of findings with a severity and a fix |
| Who reads it | The DBA, the engineering lead, and whoever approves the fixes |
| Example tools | pt-variable-advisor, MySQLTuner, sp_Blitz, pgBadger |
Monitoring
| Question | Monitoring |
|---|---|
| What it answers | Is the server healthy right now, and when did that change? |
| When it runs | Continuously, every few seconds |
| Output | Time-series graphs and alerts |
| Who reads it | The on-call engineer |
| Example tools | Prometheus exporters, PMM, CloudWatch, Datadog |
Use both: monitoring history makes a health check better, because it shows whether a finding is a one-off or a trend.
Which Percona Toolkit tools belong in a MySQL health check?
Percona Toolkit is a set of command-line tools for MySQL and the host it runs on. The latest release, 3.7.2, is dated 22 October 2026 and adds MySQL 9.7 support (Percona Toolkit release notes). It is free and licensed under the GNU GPL version 2 or the Perl Artistic License. Percona's documentation recommends testing every tool on a non-production server first, and three of them do most of the health check work.
pt-summary and pt-mysql-summary
pt-summary reports on the host: CPU, memory, mounted filesystems, disk schedulers, RAID controller, network, and top processes. Percona describes it as "not a tuning tool or diagnosis tool"; it gives you the facts a reviewer needs. It runs without root, but some sections are empty unless it does. pt-mysql-summary does the same for the server: version, uptime, replication state, a processlist summary, status counters sampled over 10 seconds, InnoDB settings, and security checks for anonymous users and users without passwords.
sudo pt-summary > pt-summary-$(hostname).txt
pt-mysql-summary --user=root --ask-pass > pt-mysql-summary-$(hostname).txtInterpretation: both reports are plain text and round many values, so two servers' reports are easy to diff. The MySQL report includes a pretty-printed my.cnf, which can contain [client] credentials. Read it before you attach it to a ticket.
pt-variable-advisor
pt-variable-advisor reads SHOW VARIABLES and flags settings that match its rules, each with a severity of NOTE, WARN, or CRIT. The rules cover InnoDB durability, binary log settings, replication error skipping, the query cache, and old server versions.
pt-variable-advisor localhost
# Or from SHOW VARIABLES output saved by the server owner
pt-variable-advisor --source-of-variables vars.txtInterpretation: treat CRIT findings as the agenda for the review meeting. Some NOTE rules fire on settings that are right for your workload, so record why you keep them rather than changing them.
pt-duplicate-key-checker
pt-duplicate-key-checker finds indexes that cover the same columns as another index, or an exact leftmost prefix of one, plus duplicate foreign keys. On InnoDB it also flags secondary keys whose suffix repeats the primary key. Under each duplicate it prints an ALTER TABLE ... DROP KEY statement, and the summary estimates the space the duplicates use.
pt-duplicate-key-checker --host db-01 --user=root --ask-pass --databases apppt-duplicate-key-checker on one schema
Illustrative output: shaped like the tool's report, not from a real server
Do not run the ALTER as printed: a query may still hint the shorter index. The --invisible option makes the printed SQL set the index INVISIBLE instead of dropping it, and making it visible again is instant.
What do MySQLTuner and the sys schema add?
MySQLTuner turns status counters into recommendations; the sys schema answers workload and index questions from inside the server.
MySQLTuner
MySQLTuner is a Perl script, version 2.9.4, licensed under GPL-3.0. Its test targets include MySQL 8.0, 8.4, and 9.7, MariaDB 10.11 to 12.3, and Percona Server 8.0. It reads status and variables, prints findings for memory, connections, InnoDB, and security, and ends with a list of recommended changes. With --cvefile it also checks your server version against a list of known CVEs. The project says the script is read-only.
wget https://mysqltuner.pl/ -O mysqltuner.pl
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv
perl mysqltuner.pl --host 127.0.0.1 --user admin_user --pass 'secret' --cvefile=vulnerabilities.csvInterpretation: the counters behind the recommendations reset on restart, so the README asks for at least 24 hours of uptime and calls results from a freshly restarted server "essentially useless." Its suggestions to raise a buffer or cache are starting points, not instructions: test each one, because a change in one area can hurt another.
Limit: it cannot see your queries, so it cannot tell you which index is missing.
The MySQL sys schema
The sys schema ships with MySQL Server, so there is nothing to install or license separately. It is a set of views over Performance Schema: formatted views for people and x$ views with raw values for scripts. Three views carry most of a health check.
-- Indexes made redundant by another index, with the DROP statement
SELECT table_schema, table_name, redundant_index_name,
dominant_index_name, sql_drop_index
FROM sys.schema_redundant_indexes;
-- Indexes with no recorded use since statistics started
SELECT * FROM sys.schema_unused_indexes;
-- Statements that scan whole tables
SELECT query, exec_count, no_index_used_count
FROM sys.statements_with_full_table_scans
LIMIT 10;Interpretation: the MySQL manual warns that schema_unused_indexes is only meaningful once the server has processed a representative workload. An index used by a monthly report looks unused for 29 days. Cross-check schema_redundant_indexes against pt-duplicate-key-checker; when both flag the same index, it is a strong candidate to make invisible.
For more sys and Performance Schema queries, see daily troubleshooting queries every MySQL DBA should know.
Which tools run a PostgreSQL health check?
PostgreSQL has no single equivalent of MySQLTuner, so combine a workload extension, a log analyzer, and threshold checks.
pg_stat_statements
pg_stat_statements is a contrib module that ships with PostgreSQL. It records planning and execution statistics for every normalized statement. It must be loaded at server start, so enabling it needs a restart, and it only works when query identifiers are computed (compute_query_id set to auto or on). By default it tracks 5,000 statements (pg_stat_statements.max).
# postgresql.conf (restart required)
shared_preload_libraries = 'pg_stat_statements'
compute_query_id = onCREATE EXTENSION pg_stat_statements;
SELECT query, calls, total_exec_time, mean_exec_time, rows,
100.0 * shared_blks_hit /
nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent
FROM pg_stat_statements
ORDER BY total_exec_time DESC
LIMIT 5;Interpretation: this query is the documentation's own example. The top rows by total_exec_time are where tuning pays off; a low hit_percent on a hot statement means it reads from disk. Times are in milliseconds and accumulate since the last pg_stat_statements_reset(), so note the reset time in the report. Our pg_stat_statements guide covers more queries.
pgBadger
pgBadger parses PostgreSQL log files into an HTML report: slowest and most frequent queries, lock waits, temporary files, checkpoints, autovacuum runs, errors, and connections per database and user. The latest release is v13.3, dated 3 November 2026, under the PostgreSQL Licence. It only reports what the server logged, so the logging settings come first.
# postgresql.conf: what pgBadger needs in the logs
log_min_duration_statement = 0 # or a threshold in ms on busy servers
log_line_prefix = '%t [%p]: '
log_checkpoints = on
log_lock_waits = on
log_temp_files = 0
log_autovacuum_min_duration = 0
lc_messages = 'C'pgbadger -j 4 -o health-check.html /var/log/postgresql/postgresql-*.logInterpretation: log_min_duration_statement = 0 logs every statement, which can be a lot of I/O on a busy server; a threshold such as 250 ms logs less, at the cost of missing fast but frequent queries. Do not enable log_statement, because pgBadger cannot parse that format. The pgBadger guide walks through the report.
check_postgres
check_postgres is a Perl script with more than 60 actions, built for Nagios but usable standalone. Each action prints one status line and exits 0, 1, 2, or 3 for OK, WARNING, CRITICAL, or UNKNOWN. The actions that matter most in a health check are txn_wraparound, bloat, last_vacuum, backends, hot_standby_delay, and replication_slots. It uses a two-clause BSD-style licence. The latest release on the project page is 2.26.0, from April 2023, so test it against your PostgreSQL major version before you rely on it.
check_postgres_txn_wraparound --host=localhost
check_postgres_bloat --port=5432 --warning='100 M' --critical='200 M'
check_postgres_last_vacuum --host=db-01 --warning='3d' --critical='7d'Interpretation: these examples come from the documentation and use the per-action symlinks, which check_postgres.pl --symlinks creates; without them, pass --action=txn_wraparound and so on. A WARNING from txn_wraparound is the most urgent finding PostgreSQL can give you, because a database that gets close to wraparound stops accepting writes.
pg_activity
pg_activity, from Dalibo, is a top-like terminal view of PostgreSQL sessions under the PostgreSQL licence. It shows running, waiting, and blocking queries with CPU, memory, and I/O per backend, refreshing every 2 seconds by default. It is live rather than point-in-time, but it belongs in a health check for one job: seeing long-running transactions and lock chains while you are on the server.
sudo -u postgres pg_activity -U postgresInterpretation: run it as a superuser, or some system and temporary file data is hidden. A session that sits "idle in transaction" for minutes holds back vacuum, which is often the root cause behind a bloat finding.
Which tools run a SQL Server health check?
SQL Server has two free, widely used sets of scripts. Both run as T-SQL, so they also work where you have no operating system access.
First Responder Kit: sp_Blitz and sp_BlitzIndex
Brent Ozar Unlimited's First Responder Kit is MIT licensed. Install it by running Install-All-Scripts.sql (or Install-Azure.sql for Azure SQL Database). It supports the SQL Server versions Microsoft still supports, SQL Server on Linux, Amazon RDS for SQL Server, and Managed Instance; on Azure SQL Database some checks are skipped. sp_Blitz is a prioritized server health check, where priority 1 is the most urgent, and the project describes it as something to run daily or weekly. sp_BlitzIndex reports missing, unused, duplicate, and problem indexes.
-- Whole-server health check, with configuration details
EXEC sp_Blitz @CheckServerInfo = 1;
-- Index review for one database, high-priority advice
EXEC sp_BlitzIndex @DatabaseName = 'AppDB', @Mode = 0;Interpretation: each sp_Blitz finding carries a priority. Work from priority 1 down. sp_BlitzIndex with @Mode = 4 gives detailed advice once the high-priority list is clear. Review overlapping missing-index suggestions together rather than creating each one as suggested.
Glenn Berry's diagnostic queries
Glenn Berry's SQL Server Diagnostic Information Queries are a script per version, from SQL Server 2005 to 2025 plus Azure SQL Database and Managed Instance, each with a blank spreadsheet that has one tab per query. A free video series explains how to read the results. The download page states no licence, so check the script header before you redistribute it.
-- Confirm the version first, then open the matching script
SELECT @@VERSION;Interpretation: use the script written for the version this returns, because each script targets one version. Run them a section at a time and paste results into the matching tab, which turns the spreadsheet into the evidence file for your report.
How do I check MongoDB and Amazon RDS health?
mongostat and mongotop
mongostat and mongotop are part of the MongoDB Database Tools (version 100.20.1 in the current documentation), licensed under the Apache License 2.0. mongostat prints one row per interval with operation counts, WiredTiger cache dirty and used percentages, queued and active readers and writers, network traffic, and connections. mongotop shows read and write time per collection; it needs the serverStatus and top privileges.
mongostat --uri='mongodb://monitor@db-01:27017/?authSource=admin' --discover -n 30 5
mongotop 30 --uri='mongodb://monitor@db-01:27017/?authSource=admin'Interpretation: with --discover, mongostat reports every member of a replica set or sharded cluster; -n 30 stops after 30 rows at 5-second intervals. A cache "dirty" percentage that stays high, or reader and writer queues that never drain, are the findings to chase. In mongotop, the collection with the most write time is usually where index review starts.
db.serverStatus() checks
The serverStatus command returns the counters behind both tools. Its output is large, so ask for the sections you need.
// mongosh
db.serverStatus().connections // current, available, active, rejected
db.serverStatus().asserts // regular, msg, user, rollovers
db.serverStatus().uptime // seconds since the process started
db.runCommand({ serverStatus: 1, repl: 1 }).replInterpretation: compare connections.current with available for headroom, and check rejected for refused connections. Rising asserts counters are not urgent alone, but they point you to the log. All counters reset on restart, so record uptime beside them.
Amazon RDS recommendations and Trusted Advisor
On Amazon RDS you cannot run host tools, but AWS runs configuration checks for you. The RDS Recommendations page flags DB instances, replicas, and parameter groups with issues such as automated backups turned off, a minor or major engine version update required, Multi-AZ not in use, storage encryption off, sync_binlog or synchronous_commit turned off, autovacuum off, and replicas open in writable mode (full list). Each has a severity of High, Medium, Low, or Informational, and the reference says which ones need downtime to apply. Threshold-based proactive recommendations need Performance Insights with a paid retention tier.
aws rds describe-db-recommendations --region ap-south-1Interpretation: run it per Region you use. A recommendation is advice, not a defect: "DB memory parameters are diverging from default" may be a deliberate tuning choice, so dismiss it with a note rather than resetting the parameters.
AWS Trusted Advisor repeats twelve of these RDS recommendations as fault tolerance checks and adds its own, such as Amazon RDS Backups, FreeStorageSpace, ReplicaLag, and RDS Not In AWS Backup Plan. On Basic or Developer Support, the console shows only service limit checks and a short list of security and fault tolerance checks, where the only RDS one is Amazon RDS Public Snapshots (check reference).
How do the health check tools compare?
The table lists every tool above. "Built in" means it ships with the database or the cloud service.
| Tool | Engine | What it checks | How it runs | Licence |
|---|---|---|---|---|
| pt-summary, pt-mysql-summary | Host, MySQL | Hardware, OS, server status, security basics | CLI on or near the host | GPL v2 or Perl Artistic |
| pt-variable-advisor | MySQL | Risky variable values | CLI or saved variables file | GPL v2 or Perl Artistic |
| pt-duplicate-key-checker | MySQL | Duplicate indexes and foreign keys | CLI, reads the schema | GPL v2 or Perl Artistic |
| MySQLTuner | MySQL, MariaDB | Memory, cache, and connection sizing; CVEs | Perl script, read-only | GPL-3.0 |
| sys schema | MySQL | Unused and redundant indexes, full scans | SQL views | Built in |
| pg_stat_statements | PostgreSQL | Query workload | Extension, restart to enable | Built in (contrib) |
| pgBadger | PostgreSQL | Slow queries, locks, checkpoints, errors from logs | Log parser, HTML report | PostgreSQL Licence |
| check_postgres | PostgreSQL | Wraparound, bloat, vacuum age, replication | Perl script, Nagios output | BSD-style |
| pg_activity | PostgreSQL | Live sessions, waits, blocking | Terminal UI | PostgreSQL licence |
| sp_Blitz, sp_BlitzIndex | SQL Server | Server health, index design | Stored procedures | MIT |
| Glenn Berry's queries | SQL Server | Server-wide diagnostic queries | T-SQL script per version | Free download; none stated |
| mongostat, mongotop | MongoDB | Operations, cache, queues, per-collection time | CLI sampler | Apache 2.0 |
| serverStatus | MongoDB | Connections, asserts, replication, cache | Database command | Built in |
| RDS recommendations | Amazon RDS | Backups, versions, Multi-AZ, risky parameters | Console, CLI, API | Built in |
| Trusted Advisor | AWS account | RDS fault tolerance and security checks | Console; API on higher support plans | Check set depends on support plan |
How do I choose between them, and how often should I run a health check?
Pick by gap, not by engine alone. For each of the nine areas in the checklist, name the tool that answers it, and accept that backups and failover need a manual test. A workable minimum set per engine:
- MySQL:
pt-mysql-summarypluspt-variable-advisorfor configuration,sysviews pluspt-duplicate-key-checkerfor indexes, and MySQLTuner as a second opinion on sizing. - PostgreSQL:
pg_stat_statementsfor workload, pgBadger for a week of logs, andcheck_postgresfor wraparound, bloat, and vacuum age. - SQL Server:
sp_Blitzfirst,sp_BlitzIndexon the busiest databases, and Glenn Berry's queries when you need wait and I/O evidence. - MongoDB:
serverStatussnapshots,mongostatduring peak, andmongotopto find the hot collections. - Amazon RDS: the Recommendations page plus the engine tools that work over a SQL connection (
sys,pg_stat_statements,sp_Blitz).
On frequency, run statistics-based checks only after a representative workload, and record when counters were last reset. Beyond that, a quarterly full health check, plus one before every major upgrade, migration, or expected traffic peak, keeps findings small enough to fix. The First Responder Kit suggests running sp_Blitz daily or weekly, which works well as a lightweight check between full reviews.
Running a point-in-time health check
Six steps from access to a written report; none of them change the server
-
Agree scope and get read-only access
List the instances, the replicas, and the questions the owner wants answered. Use a named account with only the privileges the tools need.
-
Check uptime and statistics age
If the server restarted yesterday or statistics were reset, usage-based findings are not meaningful yet. Note the date in the report.
mysql -e "SHOW GLOBAL STATUS LIKE 'Uptime'" -
Collect host and server summaries
Save the raw output with the hostname and date so the next review can diff it.
pt-mysql-summary --user=root --ask-pass \ > summary-$(hostname)-$(date +%F).txt -
Run the configuration and index checks
One configuration tool and one index tool per engine, from the list above.
pt-variable-advisor localhost pt-duplicate-key-checker --host localhost -
Review the query workload
Top statements by total time, full scans, and the slow log or pgBadger report for the same period.
-
Test one restore and write the report
Restore the latest backup to a scratch host, then list each finding with severity, evidence, fix, and whether the fix needs downtime.
Main risk: applying tool recommendations straight from the output. Every change goes through staging first, and each one is logged so you can roll it back.
Frequently asked questions
What is a database health check?
A database health check is a point-in-time review of a database server's configuration, durability settings, backups, replication, indexes, query workload, capacity, security, and version support. It ends in a written list of findings, each with a severity, the evidence, and a recommended fix. Unlike monitoring, it runs on demand, such as quarterly or before a migration.
Is MySQLTuner safe to run on production?
The MySQLTuner project describes the script as read-only: it reads status and variables and does not change configuration. The risk is in its recommendations, not the run. Wait for at least 24 hours of uptime so the counters are meaningful, and test each suggested change on staging, because a change that helps one area can hurt another.
What is the PostgreSQL equivalent of MySQLTuner?
There is no single equivalent. A PostgreSQL health check usually combines pg_stat_statements for query workload, pgBadger for a report built from the server logs, and check_postgres for threshold checks such as transaction ID wraparound, bloat, and vacuum age. pg_activity adds a live view of sessions and blocking while you work on the server.
How often should you run a database health check?
A full health check each quarter, plus one before every major upgrade, migration, or expected traffic peak, is a practical default. Lightweight checks such as sp_Blitz can run weekly between reviews. Run usage-based checks only after the server has carried a representative workload, and record when its statistics were last reset.
Can I run these tools on Amazon RDS?
Partly. Tools that need host access, such as pt-summary, cannot run on RDS. Tools that work over a SQL connection can: the MySQL sys schema, pg_stat_statements, and sp_Blitz, which supports Amazon RDS for SQL Server. Add the free RDS Recommendations page, which flags issues such as disabled backups, outdated engine versions, and unsafe durability parameters.
Key takeaways
- A health check is a written snapshot across nine areas; monitoring is a continuous signal. You need both.
- Every engine has free tools that cover configuration, indexes, and workload. Backups and failover still need a manual restore or failover test.
- Usage statistics reset on restart. Run MySQLTuner,
sys.schema_unused_indexes, and similar checks only after a representative workload. - Treat tool output as findings to verify, not changes to apply. Make indexes invisible before dropping them, and stage every parameter change.
- Keep each run's raw output, so the next health check can start from a diff.
Database health checks with JusDB
JusDB's database audit and health check service reviews performance and query workload, high availability and replication, security and access, backup and disaster recovery, OS and storage engine tuning, and cloud rightsizing. Engineers use named, read-only accounts through the access path your team issues, and the result is a report of prioritized findings and fixes.
You can also request a free audit of one database instance, subject to availability: mutual NDA before read-only access, a prioritized report within one week after access is ready, and no obligation.