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

相关推荐
yuguo.im4 分钟前
如何查看 Mysql 版本
数据库·mysql
中年程序员一枚5 分钟前
让postman调用python的开发接口,链接sqlite数据库,让前后联动起来
数据库·python·postman
weixin_462446238 分钟前
解决MongoDB官网下载过慢问题
数据库·mongodb
青蛙大侠公主15 分钟前
Spring事务
java·数据库·spring
老华带你飞20 分钟前
校务管理|基于springboot 校务管理系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·后端·spring
zzz大王1 小时前
sql 五十题 26-30
数据库·sql
小尧嵌入式2 小时前
QT软件开发知识点流程及记事本开发
服务器·开发语言·数据库·c++·qt
子夜江寒2 小时前
SQL 从基础操作到高级查询
数据库·sql
Dxy12393102162 小时前
MySQL快速入门
数据库·mysql
NaiLuo_452 小时前
MySQL表的约束
数据库·sql·mysql