postgres12.4安装pg_rman-1.3.16

操作系统版本:centos7.6 X64

pg_rman版本:pg_rman-1.3.16-pg12.tar.gz

postgres版本:postgresql-12.4.tar.gz

备份文件存放路径:/home/postgres/backup

归档日志存放路径:/home/postgres/archivelog/

postgres用户的环境变量.bash_profile

export PGHOME=/home/postgres/postgres12.4

export PGDATA=/home/postgres/data

export BACKUP_PATH=/home/postgres/backup

PATH=$PATH:/home/postgres/postgres12.4/bin

export PATH

用root用户安装pg_rman-1.3.16-pg12.tar.gz

1、把postgres的环境变量在root下export一遍

export PGHOME=/home/postgres/postgres12.4

export PGDATA=/home/postgres/data

export BACKUP_PATH=/home/postgres/backup

PATH=$PATH:/home/postgres/postgres12.4/bin

export PATH

2、进入pg_rman-1.3.16下,执行安装

make

make install

安装完毕后会在/home/postgres/postgres12.4/bin生成一个pg_rman

下面用操作系统postgres用户执行

3、修改数据库参数文件:postgresql.conf

wal_level = replica

archive_mode = on

archive_command = 'cp %p /home/postgres/archivelog/%f' #归档日志路径

4、初始化

pg_rman init

5、修改/home/postgres/backup下的pg_rman.ini

SRVLOG_PATH='/home/postgres/data/pg_wal' #wal日位置

ARCLOG_PATH='/home/postgres/archivelog' #归档日志位置

6、全库备份

pg_rman backup -b full -B /home/postgres/backup #设置了BACKUP_PATH环境变量可以省略 -B

7、验证备份

pg_rman validate -B /home/postgres/backup

8、查看备份

pg_rman show -B /home/postgres/backup

相关推荐
多弗朗皮卡丘1 小时前
MySQL表的约束
数据库·mysql
Flynn Liang5 小时前
AI Agent Redis 生产踩坑实录:13 类故障的根因、复现与调优
数据库·人工智能·redis·缓存·ai agent·故障分析
SelectDB6 小时前
开源日志平台怎么选?ELK、Loki、ClickHouse、Apache Doris 四大方案对比与选型指南
数据库
SelectDB6 小时前
ELK 磁盘空间不足怎么办?Elasticsearch 存储膨胀原因、排查步骤与 3 种降本方案
数据库
满小满7 小时前
为什么我先 ANALYZE,而不是先加索引
数据库·dba
SelectDB7 小时前
日志分析用什么数据库好?Elasticsearch、ClickHouse、Doris 选型对比与 3 个企业案例
数据库
inferno9 小时前
十三、存储过程(PROCEDURE)
数据库·sql·mysql
数据库急诊室_阿哲9 小时前
一周慢查询日志审计:1200 条里有多少真问题
运维·数据库·dba
zhangjw3410 小时前
2-4 集合运算 union /union all /intersect/except
数据库·postgresql
Decay__10 小时前
PostgreSQL DBA 日常运维手册 —— 会话、锁阻塞、慢查询、膨胀与每日巡检
运维·数据库·sql·postgresql