Giter Site home page Giter Site logo

postgresql-healthcheck-script's Introduction

PostgreSQL 数据库健康检查脚本

提供一个检查 PostgreSQL 数据库健康检查的 shell 脚本, 欢迎下载试用,如发现 bug 或者遇到问题,联系下面邮箱:

Email: [email protected]

一 Introduction

此脚本收集以下信息

  • 基本信息,如操作系统内核版本,数据库版本;

  • 数据库控制文件信息;

  • 数据库配置信息, 如 postgresql.conf , pg_hba.conf , recovery.conf 的非默认配置参数;

  • 数据库 csv 错误日志分析统计;

  • 数据库基本信息, 包括数据库大小,字符编码,表空间信息,用户/角色信息;

  • 数据库性能 top 10 SQL(按多维度统计);

  • 数据库运行状态检查(连接数,数据库年龄,索引超过4的表,膨胀检查,垃圾数据)

  • 分区表检查;

  • 数据库回滚比例,长事务检查;

二 Requirements

  • 此程序需要用到 pg_stat_statements 组件
  • 程序需要使用数据库环境变量如 $PGDATA, $PGPOT 等;

三 Supported Platforms

  • 操作系统: 目前仅支持 Linux 平台
  • 数据库版本: 目前仅支持 9.0, 9.1, 9.2, 9.3, 暂不支持其它版本;

四 README

  • 此程序目前版本仅能在数据库主机上执行;
  • 此程序需要数据库超级权限;
  • 此程序执行过程中需要占用一定资源,建议在数据库空闲时段执行。

五 Usage

    ./pg_healthcheck.sh 

备注:执行成功后生成报告文件 pg_healthcheck.report,格式为文本。

六 About me

postgresql-healthcheck-script's People

Contributors

francs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.