当前位置:网站首页>pg_ Installation and use of RMAN "PostgreSQL"
pg_ Installation and use of RMAN "PostgreSQL"
2022-07-28 23:05:00 【liuyunshengsir】
pg_rman It's a special postgresql Design of online backup and recovery tools . It supports online and point in time backup , You can also create backup catalog To maintain the DB cluster Backup information .
- Easy to use . Backup and restore with one command .
- Support full online , Incremental backup , Archive backup .
- Support backup compression . adopt gzip Tools to achieve page compression .
- Automatic backup maintenance . Automatically delete expired WAL Backup file .
- Support backup verification .
- No transactions lost during recovery . Support based on PITR Configuration file generator for .
1. Download and install
Find the corresponding version to download , Default install to path /usr/pgsql-13/bin
https://github.com/ossc-db/pg_rman/releases
wget https://github.com/ossc-db/pg_rman/releases/download/V1.3.14/pg_rman-1.3.14-1.pg13.rhel8.x86_64.rpm
yum install pg_rman-1.3.14-1.pg13.rhel8.x86_64.rpm
2.PostgreSQL configuration
sed -ir "s/#*max_wal_senders.*/max_wal_senders = 10/" postgresql.conf
sed -ir "s/#*max_replication_slots.*/max_replication_slots= 10/" postgresql.conf
sed -ir "s/#*hot_standby .*/hot_standby = on/" postgresql.conf
sed -ir "s/#*wal_level.*/wal_level = replica/" postgresql.conf
sed -ir "s/#*archive_mode.*/archive_mode = on/" postgresql.conf
sed -ir "s/#*archive_command.*/archive_command = '\/bin\/true'/" postgresql.conf
# Check
cat postgresql.conf | grep "max_replication_slots\|max_wal_senders\|wal_level\|archive_mode\|archive_command\|hot_standby "
Restart after modification
systemctl restart postgresql-13
3. initialization
[[email protected] pg_rman]# /usr/pgsql-13/bin/pg_rman --backup-path /lys/data/pg_rman --pgdata /var/lib/pgsql/13/data --arclog-path /lys/data/arclog init
INFO: ARCLOG_PATH is set to '/lys/data/arclog'
INFO: SRVLOG_PATH is set to '/var/lib/pgsql/13/data/log'
4. Full volume backup
[[email protected] pg_rman]# /usr/pgsql-13/bin/pg_rman --backup-path /lys/data/pg_rman --pgdata /var/lib/pgsql/13/data --arclog-path /lys/data/arclog backup -b full -U user001 -d db001 -h 127.0.0.1 -p 5432
Password for user user001:
INFO: copying database files
INFO: copying archived WAL files
INFO: backup complete
INFO: Please execute 'pg_rman validate' to verify the files are correctly copied.
5. Incremental backup
You must verify before incremental backup
[[email protected] pg_rman]# /usr/pgsql-13/bin/pg_rman --backup-path /lys/data/pg_rman --pgdata /var/lib/pgsql/13/data validate
INFO: validate: "2022-07-28 08:04:54" backup and archive log files by CRC
INFO: backup "2022-07-28 08:04:54" is valid
[[email protected] pg_rman]# /usr/pgsql-13/bin/pg_rman --backup-path /lys/data/pg_rman --pgdata /var/lib/pgsql/13/data show
=====================================================================
StartTime EndTime Mode Size TLI Status
=====================================================================
2022-07-28 08:05:51 2022-07-28 08:05:54 INCR 0B 1 ERROR
2022-07-28 08:04:54 2022-07-28 08:05:00 FULL 37MB 1 OK
[[email protected] pg_rman]# /usr/pgsql-13/bin/pg_rman --backup-path /lys/data/pg_rman --pgdata /var/lib/pgsql/13/data validate
INFO: validate: "2022-07-28 08:08:05" backup and archive log files by CRC
INFO: backup "2022-07-28 08:08:05" is valid
[[email protected] pg_rman]# /usr/pgsql-13/bin/pg_rman --backup-path /lys/data/pg_rman --pgdata /var/lib/pgsql/13/data show
=====================================================================
StartTime EndTime Mode Size TLI Status
=====================================================================
2022-07-28 08:08:05 2022-07-28 08:08:10 INCR 24kB 1 OK
2022-07-28 08:05:51 2022-07-28 08:05:54 INCR 0B 1 ERROR
2022-07-28 08:04:54 2022-07-28 08:05:00 FULL 37MB 1 OK
6. Delete backup
[[email protected] pg_rman]# /usr/pgsql-13/bin/pg_rman --backup-path /lys/data/pg_rman --pgdata /var/lib/pgsql/13/data delete "2022-07-28 08:05:51"
INFO: delete the backup with start time: "2022-07-28 08:05:51"
WARNING: cannot delete backup with start time "2022-07-28 08:04:54"
DETAIL: This is the latest full backup necessary for successful recovery.
[[email protected] pg_rman]# /usr/pgsql-13/bin/pg_rman --backup-path /lys/data/pg_rman --pgdata /var/lib/pgsql/13/data show
=====================================================================
StartTime EndTime Mode Size TLI Status
=====================================================================
2022-07-28 08:08:05 2022-07-28 08:08:10 INCR 24kB 1 OK
2022-07-28 08:04:54 2022-07-28 08:05:00 FULL 37MB 1 OK
边栏推荐
- shell脚本基础——Shell运行原理+变量、数组定义
- A new MPLS note from quigo, which must be read when taking the IE exam ---- quigo of Shangwen network
- Es learning directory
- 18 diagrams, intuitive understanding of neural networks, manifolds and topologies
- WebApplicationType#deduceFromClasspath
- 投资500亿元!中芯京城正式注册成立!
- LTE cell search process and sch/bch design
- OSV-q The size of tensor a (3) must match the size of tensor b (320) at non-singleton dimension 3
- 【复制】互联网术语、简称、缩写
- 安全狗入选《云安全全景图2.0》多个细项
猜你喜欢

Target detection notes SSD

Reading of "robust and communication efficient federated learning from non-i.i.d. data"

《Shortening passengers’ travel time A dynamic metro train scheduling approach using deep reinforcem》

xshell7,xftp7个人免费版官方下载,无需破解,免激活,下载即可使用

【MySQL系列】 MySQL表的增删改查(进阶)

《Shortening passengers’ travel time A dynamic metro train scheduling approach using deep reinforcem》

Record a question about the order of trigonometric function exchange integrals

Multi activity disaster recovery construction after 713 failure of station B | takintalks share

Improvement 17 of yolov5: cnn+transformer -- integrating bottleneck transformers

Nacos配置热更新的4种方式、读取项目配置文件的多种方式,@value,@RefreshScope,@NacosConfigurationProperties
随机推荐
npm run dev,运行项目后自动打开浏览器
Submission records of frontiers Publishing House (with status changes)
【MongoDB】MongoDB数据库的基础使用,特殊情况以及Mongoose的安装和创建流程(含有Mongoose固定版本安装)
安全狗入选《云安全全景图2.0》多个细项
Summary of C language learning content
Yolov5 improvement 7: loss function improvement
Es personal arrangement of relevant interview questions
Use FFT, matrix multiplication and conv2d to calculate convolution based on pytorch
NPM run dev, automatically open the browser after running the project
One of the experience of solving problems with code error reporting: CUDA does not match pytorch
Multi activity disaster recovery construction after 713 failure of station B | takintalks share
Target detection notes SSD
无代码开发平台通讯录入门教程
今年联发科5G芯片出货有望达到5000万套!
Xinhuazhang announced the completion of more than 200million a-round financing and the comprehensive layout of eda2.0 R & D
(重要)初识C语言 -- 函数
can‘t convert cuda:0 device type tensor to numpy. Use Tensor. cpu() to copy the tensor to host memory
DirectX repair tool download (where is exagear simulator package)
PCA学习
【复制】互联网术语、简称、缩写