首页 > 数据库 > 数据库开发技术 > pgcheck工具发布啦
前几天祖传SQL发出去之后,不少小伙伴在后台留言想要获取,本来想着就是收集一下我日常经常用的SQL,写着写着干脆就直接写成一个工具好了,你好我好大家好。现在,很高兴地告诉大家,pgcheck 工具正式 release 了~
使用方式很简单,直接执行即可。在之前的基础上,我进一步完善了一下
[postgres@xiongcc pgcheck_tool]$ ./pgcheck
Description: The script is used to collect specified information
Usage:
./pgcheck relation database schema : list information about tables and indexes in the specified schema
./pgcheck alltoast database schema : list all toasts and their corresponding tables
./pgcheck reltoast database relname : list the toast information of the specified table
./pgcheck dbstatus database : list all database status and statistics
./pgcheck index_bloat database : index bloat information (estimated value)
./pgcheck index_duplicate database : index duplicate information
./pgcheck index_low database : index low efficiency information
./pgcheck index_state database : index detail information
./pgcheck lock database : lock wait queue and lock wait state
./pgcheck checkpoint database : background and checkpointer state
./pgcheck freeze database : database transaction id consuming state
./pgcheck replication database : streaming replication (physical) state
./pgcheck connections database : database connections and current query
./pgcheck long_transaction database : long transaction detail
./pgcheck relation_bloat database : relation bloat information (estimated value)
./pgcheck vacuum_state database : current vacuum progress information
./pgcheck index_create database : index create progress information
./pgcheck wal_archive database : wal archive progress information
./pgcheck wal_generate database wal_path : wal generate speed (you should provide extra wal directory)
./pgcheck wait_event database : wait event and wait event type
./pgcheck partition database : native and inherit partition info (estimated value)
./pgcheck object database user : get the objects owned by the user in the specified database
./pgcheck --help or -h : print this help information
Author: xiongcc@PostgreSQL学徒, github: https://github.com/xiongcccc.
If you have any feedback or suggestions, feel free to contact with me.
Email: xiongcc_1994@126.com/xiongcc_1994@outlool.com. Wechat: _xiongcc
目前支持的功能项如下,基本囊括了日常运维PostgreSQL需要的查询:
工具目前已经开源,地址在 https://github.com/xiongcccc/pgcheck,喜欢的老铁记得一键三连。
另外有些PGer可能还没有拿到 《PostgreSQL DBA Daily 1.0》 以及 《PostgreSQL Architecture》 大图,可以在另外一个仓库自行获取 https://github.com/xiongcccc/PostgreSQL-ecosystem,这个仓库主要用于分享一些报告、书籍和个人经验等。
目前 pgcheck 完全免费,使用方式也很简单,只需要配置好正确的环境变量即可(版本也要对,比如你要检查13的库,那么psql需要是13的版本,因为代码里会做一些判断,不同版本直接的查询有所差异)
各位在使用过程中有任何BUG或者建议,可以随时联系我
后续我会不断完善该工具,比如添加操作系统层的一键获取。
原文作者:PostgreSQL学徒;如有侵权,请联系管理员删除。