- Walminer工具简介
WalMiner是从PostgreSQL的WAL(write ahead logs)日志的解析工具,旨在挖掘wal日志所有的有用信息,从而提供PG的数据恢复支持,需要将数据库日志级别配置需要大于minimal。walminer3.0版本可以解析所有的DML语句与部分重要的DDL语句,从而可以提供数据恢复支持
2.版本支持
walminer3.0支持PostgreSQL 10及其以上版本。(此版本放弃对9.x的支持)
- Walminer3.0下载安装
#安装包下载地址
https://gitee.com/movead/XLogMiner/tree/walminer_3.0_stable/
4.安装
#解压
unzip XLogMiner-walminer_3.0_stable.zip
#授权
chown -R postgres.postgres /mnt/pgsql/XLogMiner-walminer_3.0_stable
#切换用户
su - root
#添加环境变量
vim /etc/profile
export PGHOME=/mnt/pgsql
export PATH=$PGHOME/bin:$PATH
cd /mnt/pgsql/XLogMiner-walminer_3.0_stable/walminer
#编译安装
USE_PGXS=1 MAJORVERSION=12 make
#MAJORVERSION支持‘10’,‘11’,‘12’,‘13’,‘14’,‘15’,‘16’
USE_PGXS=1 MAJORVERSION=12 make install
4.查看当前PG库所安装的插件名称
postgres=# select * from pg_available_extensions;
name | default_version | installed_version | comment
--------------------+-----------------+-------------------+----------------------------------------------------------------------
walminer | 3.0 | 3.0 | analyse wal to SQL
insert_username | 1.0 | | functions for tracking who changed a table
file_fdw | 1.0 | | foreign-data wrapper for flat file access
tsm_system_time | 1.0 | | TABLESAMPLE method which accepts time in milliseconds as a limit
unaccent | 1.1 | | text search dictionary that removes accents
adminpack | 1.1 | | administrative functions for PostgreSQL
hstore_plperlu | 1.0 | | transform between hstore and plperlu
fuzzystrmatch | 1.1 | | determine similarities and distance between strings
amcheck | 1.0 | | functions for verifying relation integrity
pltcl | 1.0 | | PL/Tcl procedural language