原 PG开源的巡检工具pg_collector
Tags: 原创PGPostgreSQL巡检开源工具pg_collector
简介
GitHub:https://github.com/awslabs/pg-collector
缺点: 2022 年 7 月 29 日后再没更新。
比对:pg_collector 相较于 pg_gather 的巡检项更多更详细,但是pg_gather 在巡检的最后部分会多一项“Findings:”部分。
PG Collector for Postgresql is a sql script that gathers valuable database information and presents it in a consolidated HTML file which provides a convenient way to view and navigate between different sections of the report.
PG Collector is safe to run on production environments and does not create any database objects to produce the output.
With PG Collector an operator gains insights on various aspects of the database, such as:
- Database size
- Configuration parameters
- Installed extensions
- Vacuum & Statistics
- Unused Indexes & invalid indexes
- Users & Roles Info
- Toast Tables Mapping
- Database schemas
- Fragmentation (Bloat)
- Tablespaces Info
- Memory setting
- Tables and Indexes Size and info
- Transaction ID
- Replication slots
- public Schema info
- Unlogged Tables
and more, please check the example reports
下载
https://github.com/awslabs/pg-collector/releases
从PG 13开始,对不同的数据库,需要不同的脚本跑,但其实我们可以自己修改脚本的。
1 2 3 4 | wget https://github.com/awslabs/pg-collector/archive/refs/tags/pg-collector-V1.1-for-PostgreSQL-13.tar.gz wget https://github.com/awslabs/pg-collector/archive/refs/tags/pg-collector-V1.1-for-PostgreSQL-14.tar.gz wget https://github.com/awslabs/pg-collector/archive/refs/tags/v2.9.tar.gz |