中文字幕人妻中文_99精品欧美一区二区三区综合在线_精品久久久久一区二区_色月丁香_免费福利在线视频_欧美大片免费观看网址_国产伦精品一区二区三区在线播放_污污污污污污www网站免费_久久月本道色综合久久_色69激情爱久久_尹人香蕉久久99天天拍_国产美女www_亚洲国产精品无码7777一线_五月婷婷六月激情_看免费一级片_精品久久久久久成人av_在线色亚洲_女人另类性混交zo_国产精品青青在线观看爽香蕉_人人澡人人添人人爽一区二区

主頁 > 知識庫 > PostgreSQL物理備份恢復之 pg_rman的用法說明

PostgreSQL物理備份恢復之 pg_rman的用法說明

熱門標簽:廣州電銷機器人公司招聘 江蘇400電話辦理官方 400電話申請客服 濟南外呼網絡電話線路 地圖標注要花多少錢 電銷機器人能補救房產中介嗎 電話機器人怎么換人工座席 移動外呼系統模擬題 天津開發區地圖標注app

簡介

類似oracle 的 rman, 用于 postgres的備份與恢復

下載

https://github.com/ossc-db/pg_rman/tree/V1.3.9

安裝

tar zxvf pg_rman*.tar.gz
chown postgres.postgres -R pg_rman*
su - postgres
cd xxx/pg_rman*
make  make install 

使用

開啟歸檔

[postgres@node_206 /postgresql/pgsql/archive_log]$tail -3 /postgresql/pgsql/data/postgresql.conf 
#for pg_Rman
archive_mode = on # enables archiving; off, on, or always
archive_command = 'test ! -f /postgresql/pgsql/archive_log/%f  cp %p /postgresql/pgsql/archive_log/%f'

重啟 PG

pg_ctl restart -m fast

初始化

pg_rman init -B /postgresql/pgsql/pg_rman_backups

全量備份

pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups

實例

[postgres@node_206 /postgresql/pgsql]$pg_rman init -B /postgresql/pgsql/pg_rman_backups/
INFO: ARCLOG_PATH is set to '/postgresql/pgsql/archive_log'
INFO: SRVLOG_PATH is set to '/postgresql/pgsql/pg_log'
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$vim ~/.bash_profile 
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$source !$
source ~/.bash_profile
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql
psql (12.3)
Type "help" for help.
postgres=# \l
                 List of databases
  Name  | Owner  | Encoding |  Collate  |  Ctype  |  Access privileges  
-----------+----------+----------+-------------+-------------+-----------------------
 postgres | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 repmgr  | repmgr  | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 template1 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 test   | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
(5 rows)
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# select * from test;
 id |     crt_time     
----+----------------------------
 1 | 2020-11-17 23:23:31.407616
 2 | 2020-11-17 23:23:31.407728
 3 | 2020-11-17 23:23:31.407731
 4 | 2020-11-17 23:23:31.407732
 5 | 2020-11-17 23:23:31.407732
 6 | 2020-11-17 23:23:31.407733
 7 | 2020-11-17 23:23:31.407733
 8 | 2020-11-17 23:23:31.407734
 9 | 2020-11-17 23:23:31.407734
 10 | 2020-11-17 23:23:31.407735
(10 rows)
test=# insert into test (id) select n from generate_series(11,20) n;
INSERT 0 10
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-17 23:30:25" backup and archive log files by CRC
INFO: backup "2020-11-17 23:30:25" is valid
[postgres@node_206 /postgresql/pgsql]$pg_rman show 
ERROR: required parameter not specified: BACKUP_PATH (-B, --backup-path)
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-17 23:30:25 2020-11-17 23:30:27 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql
psql (12.3)
Type "help" for help.
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# insert into test (id) select n from generate_series(21,30) n;
INSERT 0 10
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=incremental -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-17 23:31:08" backup and archive log files by CRC
INFO: backup "2020-11-17 23:31:08" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-17 23:31:08 2020-11-17 23:31:10 INCR  33MB   6 OK
2020-11-17 23:30:25 2020-11-17 23:30:27 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql
psql (12.3)
Type "help" for help.
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# drop table test;
DROP TABLE
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_ctl stop -m fast
waiting for server to shut down.... done
server stopped
[postgres@node_206 /postgresql/pgsql]$pg_ctl start
waiting for server to start....2020-11-17 10:32:09.637 EST [58824] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-11-17 10:32:09.637 EST [58824] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 10:32:09.637 EST [58824] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 10:32:09.637 EST [58824] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 10:32:09.637 EST [58824] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 10:32:09.637 EST [58824] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 10:32:09.643 EST [58824] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 10:32:09.643 EST [58824] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 10:32:09.688 EST [58824] LOG: 00000: redirecting log output to logging collector process
2020-11-17 10:32:09.688 EST [58824] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 10:32:09.688 EST [58824] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$psql -d test
psql (12.3)
Type "help" for help.
test=# insert into test (id ) select n from generate_series(21,30) n;
ERROR: relation "test" does not exist
LINE 1: insert into test (id ) select n from generate_series(21,30) ...
          ^
test=# insert into test (id ) select n from generate_series(21,30) n;
ERROR: relation "test" does not exist
LINE 1: insert into test (id ) select n from generate_series(21,30) ...
          ^
test=# \d test
Did not find any relation named "test".
test=# \q
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$repmgr cluster show
 ID | Name   | Role  | Status    | Upstream  | Location | Priority | Timeline | Connection string                     
----+----------+---------+---------------+------------+----------+----------+----------+-------------------------------------------------------------
 1 | node_206 | primary | * running   |      | default | 100   | 6    | host=node_206 user=repmgr dbname=repmgr connect_timeout=2
 2 | node_205 | standby | ? unreachable | ? node_206 | default | 100   |     | host=node_205 user=repmgr dbname=repmgr connect_timeout=2 
WARNING: following issues were detected
 - unable to connect to node "node_205" (ID: 2)
 - node "node_205" (ID: 2) is registered as an active standby but is unreachable
HINT: execute with --verbose option to see connection error messages
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-17 23:31:08 2020-11-17 23:31:10 INCR  33MB   6 OK
2020-11-17 23:30:25 2020-11-17 23:30:27 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --restore-target-time='2020-11-17 23:30:25'
pg_rman: unrecognized option '--restore-target-time=2020-11-17 23:30:25'
ERROR: option is not specified
HINT: Try "pg_rman --help" for more information.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-11-17 23:30:25'
ERROR: PostgreSQL server is running
HINT: Please stop PostgreSQL server before executing restore.
[postgres@node_206 /postgresql/pgsql]$pg_ctl stop -m fast
waiting for server to shut down.... done
server stopped
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-11-17 23:30:25'
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-11-17 23:30:25'
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$pg_ctl start
waiting for server to start....2020-11-17 10:34:02.558 EST [58862] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-11-17 10:34:02.558 EST [58862] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 10:34:02.559 EST [58862] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 10:34:02.559 EST [58862] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 10:34:02.559 EST [58862] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 10:34:02.559 EST [58862] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 10:34:02.565 EST [58862] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 10:34:02.565 EST [58862] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 10:34:02.608 EST [58862] LOG: 00000: redirecting log output to logging collector process
2020-11-17 10:34:02.608 EST [58862] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 10:34:02.608 EST [58862] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-17 23:31:08 2020-11-17 23:31:10 INCR  33MB   6 OK
2020-11-17 23:30:25 2020-11-17 23:30:27 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
[postgres@node_206 /postgresql/pgsql]$pg_ctl stop
waiting for server to shut down.... done
server stopped
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-11-17 23:30:25'
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_ctl start
waiting for server to start....2020-11-17 10:34:22.842 EST [58881] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-11-17 10:34:22.842 EST [58881] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 10:34:22.842 EST [58881] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 10:34:22.842 EST [58881] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 10:34:22.842 EST [58881] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 10:34:22.842 EST [58881] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 10:34:22.846 EST [58881] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 10:34:22.846 EST [58881] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 10:34:22.888 EST [58881] LOG: 00000: redirecting log output to logging collector process
2020-11-17 10:34:22.888 EST [58881] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 10:34:22.888 EST [58881] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-17 23:34:26" backup and archive log files by CRC
INFO: backup "2020-11-17 23:34:26" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-17 23:34:26 2020-11-17 23:34:28 FULL  114MB   6 OK
2020-11-17 23:31:08 2020-11-17 23:31:10 INCR  33MB   6 OK
2020-11-17 23:30:25 2020-11-17 23:30:27 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql 
psql (12.3)
Type "help" for help.
postgres=# \l
                 List of databases
  Name  | Owner  | Encoding |  Collate  |  Ctype  |  Access privileges  
-----------+----------+----------+-------------+-------------+-----------------------
 postgres | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 repmgr  | repmgr  | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 template1 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 test   | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
(5 rows)
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# \dt
Did not find any relations.
test=# create table test(id int); 
CREATE TABLE
test=# drop table test(id int);
ERROR: syntax error at or near "("
LINE 1: drop table test(id int);
            ^
test=# 
test=# \q
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
postgres=# \l
                 List of databases
  Name  | Owner  | Encoding |  Collate  |  Ctype  |  Access privileges  
-----------+----------+----------+-------------+-------------+-----------------------
 postgres | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 repmgr  | repmgr  | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 template1 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 test   | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
(5 rows)
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# \dt
Did not find any relations.
test=# create table test(id int); 
CREATE TABLE
test=# drop table test(id int);
ERROR: syntax error at or near "("
LINE 1: drop table test(id int);
            ^
test=# 
test=# \q
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
                 List of databases
  Name  | Owner  | Encoding |  Collate  |  Ctype  |  Access privileges  
-----------+----------+----------+-------------+-------------+-----------------------
 postgres | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 repmgr  | repmgr  | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 template1 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 test   | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
(5 rows)
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# \dt
Did not find any relations.
test=# create table test(id int); 
CREATE TABLE
test=# drop table test(id int);
ERROR: syntax error at or near "("
LINE 1: drop table test(id int);
            ^
test=# 
test=# \q
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$pg_ctl restart -m fast
waiting for server to shut down.... done
server stopped
waiting for server to start....2020-11-17 10:36:41.191 EST [58933] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-11-17 10:36:41.191 EST [58933] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 10:36:41.192 EST [58933] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 10:36:41.192 EST [58933] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 10:36:41.192 EST [58933] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 10:36:41.192 EST [58933] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 10:36:41.197 EST [58933] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 10:36:41.197 EST [58933] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 10:36:41.229 EST [58933] LOG: 00000: redirecting log output to logging collector process
2020-11-17 10:36:41.229 EST [58933] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 10:36:41.229 EST [58933] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ll
total 28
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 23:36 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 17 23:36 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 23:36 pg_log
drwxrwxr-x. 5 postgres postgres 104 Nov 17 23:30 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$rm -rf archive_log/*
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$rm -rf pg_rman_backups/*
[postgres@node_206 /postgresql/pgsql]$ll
total 24
drwxr-xr-x. 2 postgres postgres  6 Nov 17 23:36 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 17 23:36 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 23:36 pg_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 23:36 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$pwd
/postgresql/pgsql
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ll
total 24
drwxr-xr-x. 2 postgres postgres  6 Nov 17 23:36 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 17 23:36 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 23:36 pg_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 23:36 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$pwd
/postgresql/pgsql
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
total 24
drwxr-xr-x. 2 postgres postgres  6 Nov 17 23:36 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 17 23:36 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 23:36 pg_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 23:36 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$pwd
/postgresql/pgsql
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ll
total 24
drwxr-xr-x. 2 postgres postgres  6 Nov 17 23:36 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 17 23:36 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 23:36 pg_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 23:36 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$pwd
/postgresql/pgsql
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$tail -3  $PGDATA/postgresql.conf
#for pg_Rman
archive_mode = on # enables archiving; off, on, or always
archive_command = 'test ! -f /postgresql/pgsql/archive_log/%f  cp %p /postgresql/pgsql/archive_log/%f'
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_ctl restart -m fast
waiting for server to shut down.... done
server stopped
waiting for server to start....2020-11-17 10:45:13.636 EST [59035] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-11-17 10:45:13.636 EST [59035] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 10:45:13.638 EST [59035] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 10:45:13.638 EST [59035] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 10:45:13.638 EST [59035] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 10:45:13.638 EST [59035] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 10:45:13.644 EST [59035] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 10:45:13.644 EST [59035] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 10:45:13.696 EST [59035] LOG: 00000: redirecting log output to logging collector process
2020-11-17 10:45:13.696 EST [59035] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 10:45:13.696 EST [59035] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ll
total 24
drwxr-xr-x. 2 postgres postgres  6 Nov 17 23:36 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 17 23:45 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 23:45 pg_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 23:36 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$pg_rman init -B /postgresql/pgsql/pg_rman_backups/
INFO: ARCLOG_PATH is set to '/postgresql/pgsql/archive_log'
INFO: SRVLOG_PATH is set to '/postgresql/pgsql/pg_log'
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql 
psql (12.3)
Type "help" for help.
postgres=# \l
                 List of databases
  Name  | Owner  | Encoding |  Collate  |  Ctype  |  Access privileges  
-----------+----------+----------+-------------+-------------+-----------------------
 postgres | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 repmgr  | repmgr  | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 template1 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 test   | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
(5 rows)
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# \dt
    List of relations
 Schema | Name | Type | Owner  
--------+------+-------+----------
 public | test | table | postgres
(1 row)
test=# drop table test
test-# ;
DROP TABLE
test=# create table test(id int, crt_time timestamp);
CREATE TABLE
test=# insert into test(id) select n from generate_series(1,100) n;
INSERT 0 100
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-17 23:46:22" backup and archive log files by CRC
INFO: backup "2020-11-17 23:46:22" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql 
psql (12.3)
Type "help" for help.
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# select * from test;
 id | crt_time 
-----+----------
  1 | 
  2 | 
  3 | 
  4 | 
  5 | 
  6 | 
  7 | 
  8 | 
  9 | 
 10 | 
 11 | 
 12 | 
 13 | 
 14 | 
 15 | 
 16 | 
 17 | 
 18 | 
 19 | 
 20 | 
 21 | 
 22 | 
 23 | 
 24 | 
 25 | 
 26 | 
 27 | 
 28 | 
 29 | 
 30 | 
 31 | 
 32 | 
 33 | 
 34 | 
 35 | 
 36 | 
 37 | 
 38 | 
 39 | 
 40 | 
 41 | 
 42 | 
 43 | 
 44 | 
 45 | 
 46 | 
 47 | 
 48 | 
 49 | 
 50 | 
 51 | 
 52 | 
 53 | 
 54 | 
 55 | 
 56 | 
 57 | 
 58 | 
 59 | 
 60 | 
 61 | 
 62 | 
 63 | 
 64 | 
 65 | 
 66 | 
 67 | 
 68 | 
 69 | 
 70 | 
 71 | 
 72 | 
 73 | 
 74 | 
 75 | 
 76 | 
 77 | 
 78 | 
 79 | 
 80 | 
 81 | 
 82 | 
 83 | 
 84 | 
 85 | 
 86 | 
 87 | 
 88 | 
 89 | 
 90 | 
 91 | 
 92 | 
 93 | 
 94 | 
 95 | 
 96 | 
 97 | 
 98 | 
 99 | 
 100 | 
(100 rows)
test=# 
test=# 
test=# 
test=# 
test=# 
test=# 
test=# 
test=# 
test=# 
test=# insert into test (id) select n from generate_series(101,110) n;
INSERT 0 10
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=incremental -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-17 23:47:09" backup and archive log files by CRC
INFO: backup "2020-11-17 23:47:09" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-17 23:47:09 2020-11-17 23:47:12 INCR  33MB   6 OK
2020-11-17 23:46:22 2020-11-17 23:46:24 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql -d test
psql (12.3)
Type "help" for help.
test=# create table test2( like test );
CREATE TABLE
test=# insert into test2(id) select n from generate_serires(1,100) n;
ERROR: function generate_serires(integer, integer) does not exist
LINE 1: insert into test2(id) select n from generate_serires(1,100) ...
                      ^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
test=# 
test=# insert into test2(id) select n from generate_series(1,100) n;
INSERT 0 100
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-17 23:49:32" backup and archive log files by CRC
INFO: backup "2020-11-17 23:49:32" is valid
[postgres@node_206 /postgresql/pgsql]$psql -d test
psql (12.3)
Type "help" for help.
test=# insert into test(id) select n from generate_series(101,100) n;
INSERT 0 0
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=incremental -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-17 23:49:59" backup and archive log files by CRC
INFO: backup "2020-11-17 23:49:59" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-17 23:49:59 2020-11-17 23:50:01 INCR  33MB   6 OK
2020-11-17 23:49:32 2020-11-17 23:49:35 FULL  64MB   6 OK
2020-11-17 23:47:09 2020-11-17 23:47:12 INCR  33MB   6 OK
2020-11-17 23:46:22 2020-11-17 23:46:24 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman delete 2020-11-17 23:47:09 -B /postgresql/pgsql/pg_rman_backups/
WARNING: cannot delete backup with start time "2020-11-17 23:47:09"
DETAIL: This is the incremental backup necessary for successful recovery.
WARNING: cannot delete backup with start time "2020-11-17 23:46:22"
DETAIL: This is the latest full backup necessary for successful recovery.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-17 23:49:59 2020-11-17 23:50:01 INCR  33MB   6 OK
2020-11-17 23:49:32 2020-11-17 23:49:35 FULL  64MB   6 OK
2020-11-17 23:47:09 2020-11-17 23:47:12 INCR  33MB   6 OK
2020-11-17 23:46:22 2020-11-17 23:46:24 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$pg_rman delete -f 2020-11-17 23:47:09 -B /postgresql/pgsql/pg_rman_backups/
WARNING: using force option will make some of the remaining backups unusable
DETAIL: Any remaining incremental backups that are older than the oldest available full backup cannot be restored.
INFO: delete the backup with start time: "2020-11-17 23:47:09"
INFO: delete the backup with start time: "2020-11-17 23:46:22"
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ll pg_rman_backups/
total 8
drwx------. 6 postgres postgres 62 Nov 17 23:49 20201117
drwx------. 4 postgres postgres 34 Nov 17 23:45 backup
-rw-rw-r--. 1 postgres postgres 84 Nov 17 23:45 pg_rman.ini
-rw-rw-r--. 1 postgres postgres 40 Nov 17 23:45 system_identifier
drwx------. 2 postgres postgres 6 Nov 17 23:45 timeline_history
[postgres@node_206 /postgresql/pgsql]$ll pg_rman_backups/20201117/
total 0
drwx------. 2 postgres postgres 89 Nov 17 23:50 234622
drwx------. 2 postgres postgres 89 Nov 17 23:50 234709
drwx------. 5 postgres postgres 133 Nov 17 23:49 234932
drwx------. 5 postgres postgres 133 Nov 17 23:50 234959
[postgres@node_206 /postgresql/pgsql]$ll pg_rman_backups/20201117/234622/
total 112
-rw-rw-r--. 1 postgres postgres  433 Nov 17 23:50 backup.ini
-rw-rw-r--. 1 postgres postgres  226 Nov 17 23:46 file_arclog.txt
-rw-rw-r--. 1 postgres postgres 99521 Nov 17 23:46 file_database.txt
-rwx------. 1 postgres postgres  764 Nov 17 23:46 mkdirs.sh
[postgres@node_206 /postgresql/pgsql]$ll pg_rman_backups/20201117/2347
ls: cannot access pg_rman_backups/20201117/2347: No such file or directory
[postgres@node_206 /postgresql/pgsql]$ll pg_rman_backups/20201117/234709/
total 124
-rw-rw-r--. 1 postgres postgres  438 Nov 17 23:50 backup.ini
-rw-rw-r--. 1 postgres postgres  468 Nov 17 23:47 file_arclog.txt
-rw-rw-r--. 1 postgres postgres 113305 Nov 17 23:47 file_database.txt
-rwx------. 1 postgres postgres  764 Nov 17 23:47 mkdirs.sh
[postgres@node_206 /postgresql/pgsql]$ll pg_rman_backups/20201117/234932/
total 116
drwx------. 2 postgres postgres  118 Nov 17 23:49 arclog
-rw-rw-r--. 1 postgres postgres  428 Nov 17 23:49 backup.ini
drwx------. 19 postgres postgres 4096 Nov 17 23:49 database
-rw-rw-r--. 1 postgres postgres  708 Nov 17 23:49 file_arclog.txt
-rw-rw-r--. 1 postgres postgres 99583 Nov 17 23:49 file_database.txt
-rwx------. 1 postgres postgres  764 Nov 17 23:49 mkdirs.sh
drwx------. 2 postgres postgres   6 Nov 17 23:49 srvlog
[postgres@node_206 /postgresql/pgsql]$pg_rman purge
ERROR: required parameter not specified: BACKUP_PATH (-B, --backup-path)
[postgres@node_206 /postgresql/pgsql]$pg_rman purge -B /postgresql/pgsql/pg_rman_backups/
INFO: DELETED backup "2020-11-17 23:47:09" is purged
INFO: DELETED backup "2020-11-17 23:46:22" is purged
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ll pg_rman_backups/20201117/234622/
ls: cannot access pg_rman_backups/20201117/234622/: No such file or directory
[postgres@node_206 /postgresql/pgsql]$ll pg_rman_backups/20201117
total 0
drwx------. 5 postgres postgres 133 Nov 17 23:49 234932
drwx------. 5 postgres postgres 133 Nov 17 23:50 234959
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-17 23:49:59 2020-11-17 23:50:01 INCR  33MB   6 OK
2020-11-17 23:49:32 2020-11-17 23:49:35 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql 
psql (12.3)
Type "help" for help.
postgres=# drop database test;
DROP DATABASE
postgres=# \q
[postgres@node_206 /postgresql/pgsql]$pg_ctl stop -m fast
waiting for server to shut down.... done
server stopped
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-11-17 23:49:32'
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
ERROR: could not connect to database postgres: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_ctl start
waiting for server to start....2020-11-17 10:53:41.927 EST [59212] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-11-17 10:53:41.927 EST [59212] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 10:53:41.928 EST [59212] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 10:53:41.928 EST [59212] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 10:53:41.928 EST [59212] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 10:53:41.928 EST [59212] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 10:53:41.929 EST [59212] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 10:53:41.929 EST [59212] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 10:53:41.977 EST [59212] LOG: 00000: redirecting log output to logging collector process
2020-11-17 10:53:41.977 EST [59212] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 10:53:41.977 EST [59212] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-17 23:53:43" backup and archive log files by CRC
INFO: backup "2020-11-17 23:53:43" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-17 23:53:43 2020-11-17 23:53:45 FULL  75MB   6 OK
2020-11-17 23:53:39 2020-11-17 23:53:39 FULL   0B   0 ERROR
2020-11-17 23:49:59 2020-11-17 23:50:01 INCR  33MB   6 OK
2020-11-17 23:49:32 2020-11-17 23:49:35 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql -d test
psql: error: could not connect to server: FATAL: database "test" does not exist
[postgres@node_206 /postgresql/pgsql]$psql 
psql (12.3)
Type "help" for help.
postgres=# create database test;
CREATE DATABASE
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# create table test2(id int, crt_time timestamp );
CREATE TABLE
test=# insert into test2(id) select n from generate_series(1,100) n;
INSERT 0 100
test=# 
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-17 23:58:53" backup and archive log files by CRC
INFO: backup "2020-11-17 23:58:53" is valid
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-17 23:58:53 2020-11-17 23:58:55 FULL  64MB   6 OK
2020-11-17 23:53:43 2020-11-17 23:53:45 FULL  75MB   6 OK
2020-11-17 23:53:39 2020-11-17 23:53:39 FULL   0B   0 ERROR
2020-11-17 23:49:59 2020-11-17 23:50:01 INCR  33MB   6 OK
2020-11-17 23:49:32 2020-11-17 23:49:35 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman delete -f 2020-11-17 23:53:39 -B /postgresql/pgsql/pg_rman_backups/
WARNING: using force option will make some of the remaining backups unusable
DETAIL: Any remaining incremental backups that are older than the oldest available full backup cannot be restored.
INFO: delete the backup with start time: "2020-11-17 23:53:39"
INFO: delete the backup with start time: "2020-11-17 23:49:59"
INFO: delete the backup with start time: "2020-11-17 23:49:32"
[postgres@node_206 /postgresql/pgsql]$pg_rman purge -B /postgresql/pgsql/pg_rman_backups/
INFO: DELETED backup "2020-11-17 23:53:39" is purged
INFO: DELETED backup "2020-11-17 23:49:59" is purged
INFO: DELETED backup "2020-11-17 23:49:32" is purged
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-17 23:58:53 2020-11-17 23:58:55 FULL  64MB   6 OK
2020-11-17 23:53:43 2020-11-17 23:53:45 FULL  75MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql 
psql (12.3)
Type "help" for help.
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# \dt
     List of relations
 Schema | Name | Type | Owner  
--------+-------+-------+----------
 public | test2 | table | postgres
(1 row)
test=# \c postgres
You are now connected to database "postgres" as user "postgres".
postgres=# drop database test;
DROP DATABASE
postgres=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-17 23:58:53 2020-11-17 23:58:55 FULL  64MB   6 OK
2020-11-17 23:53:43 2020-11-17 23:53:45 FULL  75MB   6 OK
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-11-17 23:58:53'
ERROR: PostgreSQL server is running
HINT: Please stop PostgreSQL server before executing restore.
[postgres@node_206 /postgresql/pgsql]$pg_ctl stop -m fast
waiting for server to shut down.... done
server stopped
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-11-17 23:58:53'
INFO: the recovery target timeline ID is not given
INFO: use timeline ID of current database cluster as recovery target: 6
INFO: calculating timeline branches to be used to recovery target point
INFO: searching latest full backup which can be used as restore start point
INFO: found the full backup can be used as base in recovery: "2020-11-17 23:53:43"
INFO: copying online WAL files and server log files
INFO: clearing restore destination
INFO: validate: "2020-11-17 23:53:43" backup and archive log files by SIZE
INFO: backup "2020-11-17 23:53:43" is valid
INFO: restoring database files from the full mode backup "2020-11-17 23:53:43"
INFO: searching incremental backup to be restored
INFO: searching backup which contained archived WAL files to be restored
INFO: backup "2020-11-17 23:53:43" is valid
INFO: restoring WAL files from backup "2020-11-17 23:53:43"
INFO: backup "2020-11-17 23:58:53" is valid
INFO: restoring WAL files from backup "2020-11-17 23:58:53"
INFO: restoring online WAL files and server log files
INFO: add recovery related options to postgresql.conf
INFO: generating recovery.signal
INFO: restore complete
HINT: Recovery will start automatically when the PostgreSQL server is started.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
ERROR: could not connect to database postgres: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
[postgres@node_206 /postgresql/pgsql]$pg_ctl start 
waiting for server to start....2020-11-17 11:00:30.910 EST [59357] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-11-17 11:00:30.910 EST [59357] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 11:00:30.910 EST [59357] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 11:00:30.910 EST [59357] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 11:00:30.910 EST [59357] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 11:00:30.910 EST [59357] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 11:00:30.914 EST [59357] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 11:00:30.914 EST [59357] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 11:00:30.965 EST [59357] LOG: 00000: redirecting log output to logging collector process
2020-11-17 11:00:30.965 EST [59357] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 11:00:30.965 EST [59357] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
INFO: copying database files
ERROR: query failed: ERROR: recovery is in progress
HINT: pg_walfile_name_offset() cannot be executed during recovery.
query was: SELECT * from pg_walfile_name_offset(pg_start_backup($1, $2, $3))
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$rm -f data/recovery.signal 
[postgres@node_206 /postgresql/pgsql]$pg_ctl restart -m fast
waiting for server to shut down.... done
server stopped
waiting for server to start....2020-11-17 11:00:51.204 EST [59374] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-11-17 11:00:51.204 EST [59374] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 11:00:51.205 EST [59374] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 11:00:51.205 EST [59374] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 11:00:51.205 EST [59374] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 11:00:51.205 EST [59374] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 11:00:51.210 EST [59374] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 11:00:51.210 EST [59374] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 11:00:51.270 EST [59374] LOG: 00000: redirecting log output to logging collector process
2020-11-17 11:00:51.270 EST [59374] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 11:00:51.270 EST [59374] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-18 00:00:53" backup and archive log files by CRC
INFO: backup "2020-11-18 00:00:53" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 00:00:53 2020-11-18 00:00:55 FULL  159MB   6 OK
2020-11-18 00:00:34 2020-11-18 00:00:34 FULL   0B   0 ERROR
2020-11-18 00:00:26 2020-11-18 00:00:26 FULL   0B   0 ERROR
2020-11-17 23:58:53 2020-11-17 23:58:55 FULL  64MB   6 OK
2020-11-17 23:53:43 2020-11-17 23:53:45 FULL  75MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql 
psql (12.3)
Type "help" for help.
postgres=# \l
                 List of databases
  Name  | Owner  | Encoding |  Collate  |  Ctype  |  Access privileges  
-----------+----------+----------+-------------+-------------+-----------------------
 postgres | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 repmgr  | repmgr  | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 template1 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
(4 rows)
postgres=# \c test
FATAL: database "test" does not exist
Previous connection kept
postgres=# \q
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 00:00:53 2020-11-18 00:00:55 FULL  159MB   6 OK
2020-11-18 00:00:34 2020-11-18 00:00:34 FULL   0B   0 ERROR
2020-11-18 00:00:26 2020-11-18 00:00:26 FULL   0B   0 ERROR
2020-11-17 23:58:53 2020-11-17 23:58:55 FULL  64MB   6 OK
2020-11-17 23:53:43 2020-11-17 23:53:45 FULL  75MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql 
psql (12.3)
Type "help" for help.
postgres=# \l
                 List of databases
  Name  | Owner  | Encoding |  Collate  |  Ctype  |  Access privileges  
-----------+----------+----------+-------------+-------------+-----------------------
 postgres | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 repmgr  | repmgr  | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 template1 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
(4 rows)
postgres=# \c test
FATAL: database "test" does not exist
Previous connection kept
postgres=# \q
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_ctl restart -m fast
waiting for server to shut down.... done
server stopped
waiting for server to start....2020-11-17 11:01:30.816 EST [59423] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-11-17 11:01:30.816 EST [59423] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 11:01:30.822 EST [59423] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 11:01:30.822 EST [59423] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 11:01:30.822 EST [59423] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 11:01:30.822 EST [59423] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 11:01:30.837 EST [59423] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 11:01:30.837 EST [59423] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 11:01:30.877 EST [59423] LOG: 00000: redirecting log output to logging collector process
2020-11-17 11:01:30.877 EST [59423] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 11:01:30.877 EST [59423] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$ll
total 28
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 00:01 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 18 00:01 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 00:01 pg_log
drwxrwxr-x. 6 postgres postgres 120 Nov 18 00:00 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$rm -rf archive_log/* pg_rman_backups/*
[postgres@node_206 /postgresql/pgsql]$ll
total 24
drwxr-xr-x. 2 postgres postgres  6 Nov 18 00:01 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 18 00:01 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 00:01 pg_log
drwxrwxr-x. 2 postgres postgres  6 Nov 18 00:01 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$ll
total 24
drwxr-xr-x. 2 postgres postgres  6 Nov 18 00:01 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 18 00:01 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 00:01 pg_log
drwxrwxr-x. 2 postgres postgres  6 Nov 18 00:01 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$ll pg_rman_backups/
total 0
[postgres@node_206 /postgresql/pgsql]$ll archive_log/
total 0
[postgres@node_206 /postgresql/pgsql]$ll
total 24
drwxr-xr-x. 2 postgres postgres  6 Nov 18 00:01 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 18 00:01 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 00:01 pg_log
drwxrwxr-x. 2 postgres postgres  6 Nov 18 00:01 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$ll
total 24
drwxr-xr-x. 2 postgres postgres  6 Nov 18 00:01 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 18 00:01 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 00:01 pg_log
drwxrwxr-x. 2 postgres postgres  6 Nov 18 00:01 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$ll pg_rman_backups/
total 0
[postgres@node_206 /postgresql/pgsql]$ll archive_log/
total 0
[postgres@node_206 /postgresql/pgsql]$ll
total 24
drwxr-xr-x. 2 postgres postgres  6 Nov 18 00:01 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 18 00:01 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 00:01 pg_log
drwxrwxr-x. 2 postgres postgres  6 Nov 18 00:01 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$pg_ctl restart
waiting for server to shut down.... done
server stopped
waiting for server to start....2020-11-17 11:08:26.228 EST [59464] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-11-17 11:08:26.228 EST [59464] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 11:08:26.233 EST [59464] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 11:08:26.233 EST [59464] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 11:08:26.233 EST [59464] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 11:08:26.233 EST [59464] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 11:08:26.236 EST [59464] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 11:08:26.236 EST [59464] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 11:08:26.293 EST [59464] LOG: 00000: redirecting log output to logging collector process
2020-11-17 11:08:26.293 EST [59464] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 11:08:26.293 EST [59464] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pwd
/postgresql/pgsql
[postgres@node_206 /postgresql/pgsql]$psql
psql (12.3)
Type "help" for help.
postgres=# \l
                 List of databases
  Name  | Owner  | Encoding |  Collate  |  Ctype  |  Access privileges  
-----------+----------+----------+-------------+-------------+-----------------------
 postgres | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 repmgr  | repmgr  | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 template1 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
(4 rows)
postgres=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman init -B /postgresql/pgsql/pg_rman_backups/
INFO: ARCLOG_PATH is set to '/postgresql/pgsql/archive_log'
INFO: SRVLOG_PATH is set to '/postgresql/pgsql/pg_log'
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql
psql (12.3)
Type "help" for help.
postgres=# create database test;
CREATE DATABASE
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# create table test(id int, crt_time timestamp default clock_timestamp());
CREATE TABLE
test=# insert into test (id) select n from generate_series(1,100) n;
INSERT 0 100
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-18 00:09:40" backup and archive log files by CRC
INFO: backup "2020-11-18 00:09:40" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql -d test
psql (12.3)
Type "help" for help.
test=# insert into test (id) select n from generate_series(101,110) n;
INSERT 0 10
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=incremental -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 00:10:03 2020-11-18 00:10:05 INCR  33MB   6 DONE
2020-11-18 00:09:40 2020-11-18 00:09:42 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-18 00:10:03" backup and archive log files by CRC
INFO: backup "2020-11-18 00:10:03" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 00:10:03 2020-11-18 00:10:05 INCR  33MB   6 OK
2020-11-18 00:09:40 2020-11-18 00:09:42 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql -d test
psql (12.3)
Type "help" for help.
test=# create table test2(like test);
CREATE TABLE
test=# insert into test2 (id) select n from generate_series(1,100) n;
INSERT 0 100
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 00:10:49 2020-11-18 00:10:51 FULL  64MB   6 DONE
2020-11-18 00:10:03 2020-11-18 00:10:05 INCR  33MB   6 OK
2020-11-18 00:09:40 2020-11-18 00:09:42 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-18 00:10:49" backup and archive log files by CRC
INFO: backup "2020-11-18 00:10:49" is valid
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 00:10:49 2020-11-18 00:10:51 FULL  64MB   6 OK
2020-11-18 00:10:03 2020-11-18 00:10:05 INCR  33MB   6 OK
2020-11-18 00:09:40 2020-11-18 00:09:42 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman delete -f 2020-11-18 00:10:03 
ERROR: required parameter not specified: BACKUP_PATH (-B, --backup-path)
[postgres@node_206 /postgresql/pgsql]$pg_rman delete -f 2020-11-18 00:10:03 -B /postgresql/pgsql/pg_rman_backups/
WARNING: using force option will make some of the remaining backups unusable
DETAIL: Any remaining incremental backups that are older than the oldest available full backup cannot be restored.
INFO: delete the backup with start time: "2020-11-18 00:10:03"
INFO: delete the backup with start time: "2020-11-18 00:09:40"
[postgres@node_206 /postgresql/pgsql]$pg_rman purge -B /postgresql/pgsql/pg_rman_backups/
INFO: DELETED backup "2020-11-18 00:10:03" is purged
INFO: DELETED backup "2020-11-18 00:09:40" is purged
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 00:10:49 2020-11-18 00:10:51 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql 
psql (12.3)
Type "help" for help.
postgres=# \l
                 List of databases
  Name  | Owner  | Encoding |  Collate  |  Ctype  |  Access privileges  
-----------+----------+----------+-------------+-------------+-----------------------
 postgres | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 repmgr  | repmgr  | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 template1 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 test   | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
(5 rows)
postgres=# drop database test;
DROP DATABASE
postgres=# \q
[postgres@node_206 /postgresql/pgsql]$pg_ctl stop
waiting for server to shut down.... done
server stopped
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/data/ --recovery-target-time='2020-11-18 00:10:49'
ERROR: required parameter not specified: ARCLOG_PATH (-A, --arclog-path)
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/data/ --recovery-target-time='2020-11-18 00:10:49' -A /postgresql/pgsql/archive_log/
ERROR: required parameter not specified: SRVLOG_PATH (-S, --srvlog-path)
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/data/ --recovery-target-time='2020-11-18 00:10:49' -A /postgresql/pgsql/archive_log/ -S /postgresql/pgsql/pg_log/
ERROR: could not open file "/postgresql/pgsql/data//pg_rman.ini": No such file or directory
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/data/ --recovery-target-time='2020-11-18 00:10:49'
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-11-18 00:10:49'
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 00:10:49 2020-11-18 00:10:51 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-11-18 00:10:00\'
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-11-18 00:10:00'
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-11-18'
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ 
INFO: the recovery target timeline ID is not given
INFO: use timeline ID of current database cluster as recovery target: 6
INFO: calculating timeline branches to be used to recovery target point
INFO: searching latest full backup which can be used as restore start point
INFO: found the full backup can be used as base in recovery: "2020-11-18 00:10:49"
INFO: copying online WAL files and server log files
INFO: clearing restore destination
INFO: validate: "2020-11-18 00:10:49" backup and archive log files by SIZE
INFO: backup "2020-11-18 00:10:49" is valid
INFO: restoring database files from the full mode backup "2020-11-18 00:10:49"
INFO: searching incremental backup to be restored
INFO: searching backup which contained archived WAL files to be restored
INFO: backup "2020-11-18 00:10:49" is valid
INFO: restoring WAL files from backup "2020-11-18 00:10:49"
INFO: restoring online WAL files and server log files
INFO: add recovery related options to postgresql.conf
INFO: generating recovery.signal
INFO: restore complete
HINT: Recovery will start automatically when the PostgreSQL server is started.
[postgres@node_206 /postgresql/pgsql]$rm -f data/recovery.signal 
[postgres@node_206 /postgresql/pgsql]$pg_ctl start
waiting for server to start....2020-11-17 11:14:46.684 EST [59594] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-11-17 11:14:46.684 EST [59594] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 11:14:46.689 EST [59594] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 11:14:46.689 EST [59594] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 11:14:46.689 EST [59594] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 11:14:46.689 EST [59594] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 11:14:46.691 EST [59594] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 11:14:46.691 EST [59594] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 11:14:46.732 EST [59594] LOG: 00000: redirecting log output to logging collector process
2020-11-17 11:14:46.732 EST [59594] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 11:14:46.732 EST [59594] LOCATION: SysLogger_Start, syslogger.c:675
 stopped waiting
pg_ctl: could not start server
Examine the log output.
[postgres@node_206 /postgresql/pgsql]$touch data/recovery.signal
[postgres@node_206 /postgresql/pgsql]$pg_ctl start
waiting for server to start....2020-11-17 11:15:04.292 EST [59600] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-11-17 11:15:04.292 EST [59600] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 11:15:04.293 EST [59600] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 11:15:04.293 EST [59600] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 11:15:04.293 EST [59600] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 11:15:04.293 EST [59600] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 11:15:04.296 EST [59600] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 11:15:04.296 EST [59600] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 11:15:04.347 EST [59600] LOG: 00000: redirecting log output to logging collector process
2020-11-17 11:15:04.347 EST [59600] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 11:15:04.347 EST [59600] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$psql 
psql (12.3)
Type "help" for help.
postgres=# l
                 List of databases
  Name  | Owner  | Encoding |  Collate  |  Ctype  |  Access privileges  
-----------+----------+----------+-------------+-------------+-----------------------
 postgres | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 repmgr  | repmgr  | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 template1 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
(4 rows)
postgres=# q
[postgres@node_206 /postgresql/pgsql]$pg_rman 
ERROR: required parameter not specified: BACKUP_PATH (-B, --backup-path)
[postgres@node_206 /postgresql/pgsql]$pg_rman --help
pg_rman manage backup/recovery of PostgreSQL database.
Usage:

 pg_rman OPTION init
 pg_rman OPTION backup
 pg_rman OPTION restore
 pg_rman OPTION show [DATE]
 pg_rman OPTION show detail [DATE]
 pg_rman OPTION validate [DATE]
 pg_rman OPTION delete DATE
 pg_rman OPTION purge
Common Options:

 -D, --pgdata=PATH     location of the database storage area
 -A, --arclog-path=PATH  location of archive WAL storage area
 -S, --srvlog-path=PATH  location of server log storage area
 -B, --backup-path=PATH  location of the backup storage area
 -c, --check        show what would have been done
 -v, --verbose       show what detail messages
 -P, --progress      show progress of processed files
Backup options:

 -b, --backup-mode=MODE  full, incremental, or archive
 -s, --with-serverlog   also backup server log files
 -Z, --compress-data    compress data backup with zlib
 -C, --smooth-checkpoint  do smooth checkpoint before backup
 -F, --full-backup-on-error  switch to full backup mode
                if pg_rman cannot find validate full backup
                on current timeline
   NOTE: this option is only used in --backup-mode=incremental or archive.
 --keep-data-generations=NUM keep NUM generations of full data backup
 --keep-data-days=NUM    keep enough data backup to recover to N days ago
 --keep-arclog-files=NUM  keep NUM of archived WAL
 --keep-arclog-days=DAY  keep archived WAL modified in DAY days
 --keep-srvlog-files=NUM  keep NUM of serverlogs
 --keep-srvlog-days=DAY  keep serverlog modified in DAY days
 --standby-host=HOSTNAME  standby host when taking backup from standby
 --standby-port=PORT    standby port when taking backup from standby
Restore options:

 --recovery-target-time  time stamp up to which recovery will proceed
 --recovery-target-xid   transaction ID up to which recovery will proceed
 --recovery-target-inclusive whether we stop just after the recovery target
 --recovery-target-timeline recovering into a particular timeline
 --hard-copy         copying archivelog not symbolic link
Catalog options:

 -a, --show-all      show deleted backup too
Delete options:

 -f, --force        forcibly delete backup older than given DATE
Connection options:

 -d, --dbname=DBNAME    database to connect
 -h, --host=HOSTNAME    database server host or socket directory
 -p, --port=PORT      database server port
 -U, --username=USERNAME  user name to connect as
 -w, --no-password     never prompt for password
 -W, --password      force password prompt
Generic options:

 -q, --quiet        don't show any INFO or DEBUG messages
 --debug          show DEBUG messages
 --help          show this help, then exit
 --version         output version information, then exit
Read the website for details. http://github.com/ossc-db/pg_rman>
Report bugs to http://github.com/ossc-db/pg_rman/issues>.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pwd
/postgresql/pgsql
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
Catalog options:

 -a, --show-all      show deleted backup too
Delete options:

 -f, --force        forcibly delete backup older than given DATE
Connection options:

 -d, --dbname=DBNAME    database to connect
 -h, --host=HOSTNAME    database server host or socket directory
 -p, --port=PORT      database server port
 -U, --username=USERNAME  user name to connect as
 -w, --no-password     never prompt for password
 -W, --password      force password prompt
Generic options:

 -q, --quiet        don't show any INFO or DEBUG messages
 --debug          show DEBUG messages
 --help          show this help, then exit
 --version         output version information, then exit
Read the website for details. http://github.com/ossc-db/pg_rman>
Report bugs to http://github.com/ossc-db/pg_rman/issues>.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pwd
/postgresql/pgsql
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 00:10:49 2020-11-18 00:10:51 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ll
total 28
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 00:15 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 18 02:41 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 00:15 pg_log
drwxrwxr-x. 5 postgres postgres 104 Nov 18 00:09 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
 --version         output version information, then exit
Read the website for details. http://github.com/ossc-db/pg_rman>
Report bugs to http://github.com/ossc-db/pg_rman/issues>.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pwd
/postgresql/pgsql
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 00:10:49 2020-11-18 00:10:51 FULL  64MB   6 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ll
total 28
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 00:15 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 18 02:41 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 00:15 pg_log
drwxrwxr-x. 5 postgres postgres 104 Nov 18 00:09 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$pg_ctl restart -m fast
waiting for server to shut down.... done
server stopped
waiting for server to start....2020-11-17 13:41:36.369 EST [60239] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-11-17 13:41:36.369 EST [60239] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 13:41:36.371 EST [60239] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 13:41:36.371 EST [60239] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 13:41:36.371 EST [60239] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 13:41:36.371 EST [60239] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 13:41:36.377 EST [60239] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 13:41:36.377 EST [60239] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 13:41:36.466 EST [60239] LOG: 00000: redirecting log output to logging collector process
2020-11-17 13:41:36.466 EST [60239] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 13:41:36.466 EST [60239] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$ll
total 28
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 02:41 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 18 02:41 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 02:41 pg_log
drwxrwxr-x. 5 postgres postgres 104 Nov 18 00:09 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$rm -rf archive_log/*
[postgres@node_206 /postgresql/pgsql]$rm -rf pg_rman_backups/*
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
2020-11-17 13:41:36.369 EST [60239] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 13:41:36.371 EST [60239] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 13:41:36.371 EST [60239] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 13:41:36.371 EST [60239] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 13:41:36.371 EST [60239] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 13:41:36.377 EST [60239] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 13:41:36.377 EST [60239] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 13:41:36.466 EST [60239] LOG: 00000: redirecting log output to logging collector process
2020-11-17 13:41:36.466 EST [60239] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 13:41:36.466 EST [60239] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$ll
total 28
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 02:41 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Nov 18 02:41 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Nov 18 02:41 pg_log
drwxrwxr-x. 5 postgres postgres 104 Nov 18 00:09 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$rm -rf archive_log/*
[postgres@node_206 /postgresql/pgsql]$rm -rf pg_rman_backups/*
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$pg_ctl restart -m fast
waiting for server to shut down.... done
server stopped
waiting for server to start....2020-11-17 13:41:51.227 EST [60254] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-11-17 13:41:51.227 EST [60254] LOCATION: PostmasterMain, postmaster.c:998
2020-11-17 13:41:51.228 EST [60254] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-11-17 13:41:51.228 EST [60254] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 13:41:51.228 EST [60254] LOG: 00000: listening on IPv6 address "::", port 5432
2020-11-17 13:41:51.228 EST [60254] LOCATION: StreamServerPort, pqcomm.c:593
2020-11-17 13:41:51.239 EST [60254] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-11-17 13:41:51.239 EST [60254] LOCATION: StreamServerPort, pqcomm.c:587
2020-11-17 13:41:51.372 EST [60254] LOG: 00000: redirecting log output to logging collector process
2020-11-17 13:41:51.372 EST [60254] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-11-17 13:41:51.372 EST [60254] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql
psql (12.3)
Type "help" for help.
postgres=# \l
                 List of databases
  Name  | Owner  | Encoding |  Collate  |  Ctype  |  Access privileges  
-----------+----------+----------+-------------+-------------+-----------------------
 postgres | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 repmgr  | repmgr  | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 template1 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
(4 rows)
postgres=# \q
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$history |grep pg_rman |grep init
 519 pg_rman init -B /postgresql/pgsql/pg_rman_backups/
 538 pg_rman init -B /postgresql/pgsql/pg_rman_backups
 544 pg_rman init -B /postgresql/pgsql/pg_rman_backups
 725 ll /postgresql/pgsql/pg_rman_backups/*init
 926 ll /postgresql/pgsql/pg_rman_backups/*init
 927 pg_rman init -B /postgresql/pgsql/pg_rman_backups
 976 pg_rman init -B 
 977 pg_rman init 
 980 pg_rman init 
 981 pg_rman init -B /postgresql/pgsql/pg_rman_backups/
 1029 pg_rman init -B /postgresql/pgsql/pg_rman_backups/
 1102 pg_rman init -B /postgresql/pgsql/pg_rman_backups/
 1152 history |grep pg_rman |grep init
[postgres@node_206 /postgresql/pgsql]$pg_rman init -B /postgresql/pgsql/pg_rman_backups/
INFO: ARCLOG_PATH is set to '/postgresql/pgsql/archive_log'
INFO: SRVLOG_PATH is set to '/postgresql/pgsql/pg_log'
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql
psql (12.3)
Type "help" for help.
postgres=# create database test;
CREATE DATABASE
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# create table test(id int, crt_time timestamp default clock_timestamp());
CREATE TABLE
test=# insert into test(id) select n from generate_series
test-# (1,1000) n;
INSERT 0 1000
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-18 02:43:17" backup and archive log files by CRC
INFO: backup "2020-11-18 02:43:17" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 02:43:17 2020-11-18 02:43:19 FULL  64MB  10 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$cd pg_rman_backups/
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$ls
20201118 backup pg_rman.ini system_identifier timeline_history
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$ll
total 8
drwx------. 3 postgres postgres 20 Nov 18 02:43 20201118
drwx------. 4 postgres postgres 34 Nov 18 02:42 backup
-rw-rw-r--. 1 postgres postgres 84 Nov 18 02:42 pg_rman.ini
-rw-rw-r--. 1 postgres postgres 40 Nov 18 02:42 system_identifier
drwx------. 2 postgres postgres 6 Nov 18 02:42 timeline_history
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$vim *ini
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-18 02:43:17" backup and archive log files by CRC
INFO: backup "2020-11-18 02:43:17" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 02:43:17 2020-11-18 02:43:19 FULL  64MB  10 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$cd pg_rman_backups/
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$ls
20201118 backup pg_rman.ini system_identifier timeline_history
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$ll
total 8
drwx------. 3 postgres postgres 20 Nov 18 02:43 20201118
drwx------. 4 postgres postgres 34 Nov 18 02:42 backup
-rw-rw-r--. 1 postgres postgres 84 Nov 18 02:42 pg_rman.ini
-rw-rw-r--. 1 postgres postgres 40 Nov 18 02:42 system_identifier
drwx------. 2 postgres postgres 6 Nov 18 02:42 timeline_history
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$vim *ini
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 02:43:17 2020-11-18 02:43:19 FULL  64MB  10 OK
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/ detail
======================================================================================================================
 StartTime      EndTime       Mode  Data ArcLog SrvLog  Total Compressed CurTLI ParentTLI Status 
======================================================================================================================
2020-11-18 02:43:17 2020-11-18 02:43:19 FULL  44MB  33MB  ----  64MB    false   10     0 OK
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$psql -U postgres -d test
psql (12.3)
Type "help" for help.
test=# \dt
    List of relations
 Schema | Name | Type | Owner  
--------+------+-------+----------
 public | test | table | postgres
(1 row)
test=# select count(*) from test;
 count 
-------
 1000
(1 row)
test=# insert into test (id ) select n from generate_series(1001, 2000) n ;
INSERT 0 1000
test=# \q
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$pg_rman backup -bi -B /postgresql/pgsql/pg_rman_backups
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.
INFO: start deleting old archived WAL files from ARCLOG_PATH (keep days = 10)
INFO: the threshold timestamp calculated by keep days is "2020-11-08 00:00:00"
INFO: start deleting old backup (keep generations = 3 AND keep after = 2020-09-19 00:00:00)
INFO: does not include the backup just taken
INFO: backup "2020-11-18 02:43:17" should be kept
DETAIL: This is the 1st latest full backup.
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-11-18 02:46:41" backup and archive log files by CRC
INFO: backup "2020-11-18 02:46:41" is valid
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$date
Wed Nov 18 02:48:04 CST 2020
(reverse-i-search)`': ^C
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$psql
psql (12.3)
Type "help" for help.
postgres=# select now();
       now       
-------------------------------
 2020-11-18 02:48:18.215429+08
(1 row)
postgres=# \q
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$exit
logout
[root@node_206 ~]# history | grep ntpdate
 467 history | grep ntpdate
[root@node_206 ~]# ntpdate time.ntp.org
Error resolving time.ntp.org: Name or service not known (-2)
18 Nov 02:49:19 ntpdate[60350]: Can't find host time.ntp.org: Name or service not known (-2)
18 Nov 02:49:19 ntpdate[60350]: no servers can be used, exiting
[root@node_206 ~]# ping baidu.com
PING baidu.com (220.181.38.148) 56(84) bytes of data.
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=1 ttl=50 time=61.3 ms
^C
--- baidu.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 61.374/61.374/61.374/0.000 ms
[root@node_206 ~]# ntpdate 0.cn.pool.ntp.org
20 Dec 22:36:38 ntpdate[60355]: step time server 5.79.108.34 offset 2836002.583561 sec
[root@node_206 ~]# 
[root@node_206 ~]# date
Sun Dec 20 22:36:40 CST 2020
[root@node_206 ~]# vim /etc/crontab
postgres=# select now();
       now       
-------------------------------
 2020-11-18 02:48:18.215429+08
(1 row)
postgres=# \q
[postgres@node_206 /postgresql/pgsql/pg_rman_backups]$exit
logout
[root@node_206 ~]# history | grep ntpdate
 467 history | grep ntpdate
[root@node_206 ~]# ntpdate time.ntp.org
Error resolving time.ntp.org: Name or service not known (-2)
18 Nov 02:49:19 ntpdate[60350]: Can't find host time.ntp.org: Name or service not known (-2)
18 Nov 02:49:19 ntpdate[60350]: no servers can be used, exiting
[root@node_206 ~]# ping baidu.com
PING baidu.com (220.181.38.148) 56(84) bytes of data.
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=1 ttl=50 time=61.3 ms
^C
--- baidu.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 61.374/61.374/61.374/0.000 ms
[root@node_206 ~]# ntpdate 0.cn.pool.ntp.org
20 Dec 22:36:38 ntpdate[60355]: step time server 5.79.108.34 offset 2836002.583561 sec
[root@node_206 ~]# 
[root@node_206 ~]# date
Sun Dec 20 22:36:40 CST 2020
[root@node_206 ~]# vim /etc/crontab
[root@node_206 ~]# lsd
-bash: lsd: command not found
[root@node_206 ~]# 
[root@node_206 ~]# ls
anaconda-ks.cfg
[root@node_206 ~]# date
Sun Dec 20 22:37:13 CST 2020
[root@node_206 ~]# psql
-bash: psql: command not found
[root@node_206 ~]# ip ro show
default via 192.168.0.1 dev eth0 proto static metric 100 
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.206 metric 100 
[root@node_206 ~]# psql
-bash: psql: command not found
[root@node_206 ~]# su - postgres
Last login: Tue Nov 17 22:47:52 CST 2020 on pts/1
[postgres@node_206 ~]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 02:46:41 2020-11-18 02:46:43 INCR  59kB  10 OK
2020-11-18 02:43:17 2020-11-18 02:43:19 FULL  64MB  10 OK
[postgres@node_206 ~]$
[postgres@node_206 ~]$vim $PGDATA/postgresql.conf
[root@node_206 ~]# ntpdate 0.cn.pool.ntp.org
20 Dec 22:36:38 ntpdate[60355]: step time server 5.79.108.34 offset 2836002.583561 sec
[root@node_206 ~]# 
[root@node_206 ~]# date
Sun Dec 20 22:36:40 CST 2020
[root@node_206 ~]# vim /etc/crontab
[root@node_206 ~]# lsd
-bash: lsd: command not found
[root@node_206 ~]# 
[root@node_206 ~]# ls
anaconda-ks.cfg
[root@node_206 ~]# date
Sun Dec 20 22:37:13 CST 2020
[root@node_206 ~]# psql
-bash: psql: command not found
[root@node_206 ~]# ip ro show
default via 192.168.0.1 dev eth0 proto static metric 100 
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.206 metric 100 
[root@node_206 ~]# psql
-bash: psql: command not found
[root@node_206 ~]# su - postgres
Last login: Tue Nov 17 22:47:52 CST 2020 on pts/1
[postgres@node_206 ~]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-11-18 02:46:41 2020-11-18 02:46:43 INCR  59kB  10 OK
2020-11-18 02:43:17 2020-11-18 02:43:19 FULL  64MB  10 OK
[postgres@node_206 ~]$
[postgres@node_206 ~]$vim $PGDATA/postgresql.conf
[postgres@node_206 ~]$pg_ctl restart -m fast
waiting for server to shut down....
 done
server stopped
waiting for server to start....2020-12-20 09:37:46.967 EST [60411] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-12-20 09:37:46.967 EST [60411] LOCATION: PostmasterMain, postmaster.c:998
2020-12-20 09:37:46.969 EST [60411] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-12-20 09:37:46.969 EST [60411] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 09:37:46.969 EST [60411] LOG: 00000: listening on IPv6 address "::", port 5432
2020-12-20 09:37:46.969 EST [60411] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 09:37:46.971 EST [60411] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-12-20 09:37:46.971 EST [60411] LOCATION: StreamServerPort, pqcomm.c:587
2020-12-20 09:37:47.014 EST [60411] LOG: 00000: redirecting log output to logging collector process
2020-12-20 09:37:47.014 EST [60411] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-12-20 09:37:47.014 EST [60411] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 ~]$
[postgres@node_206 ~]$ls
postgres_dba test.dmp
[postgres@node_206 ~]$ll
total 4
drwxrwxr-x. 10 postgres postgres 198 Nov 17 03:00 postgres_dba
-rw-rw-r--. 1 postgres postgres 1275 Nov 17 14:08 test.dmp
[postgres@node_206 ~]$cd /postgresql/p
-bash: cd: /postgresql/p: No such file or directory
[postgres@node_206 ~]$cd /postgresql/pgsql/
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$ll
total 28
drwxr-xr-x. 2 postgres postgres 262 Dec 20 22:37 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Dec 20 22:37 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Dec 20 22:37 pg_log
drwxrwxr-x. 5 postgres postgres 104 Nov 18 02:45 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$rm -rf archive_log/* pg_rman_backups/*
[postgres@node_206 /postgresql/pgsql]$ll
total 28
drwxr-xr-x. 2 postgres postgres  6 Dec 20 22:37 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Dec 20 22:37 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Dec 20 22:37 pg_log
drwxrwxr-x. 2 postgres postgres  6 Dec 20 22:37 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ll backups/
total 0
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$ll
total 28
drwxr-xr-x. 2 postgres postgres 262 Dec 20 22:37 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Dec 20 22:37 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Dec 20 22:37 pg_log
drwxrwxr-x. 5 postgres postgres 104 Nov 18 02:45 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$rm -rf archive_log/* pg_rman_backups/*
[postgres@node_206 /postgresql/pgsql]$ll
total 28
drwxr-xr-x. 2 postgres postgres  6 Dec 20 22:37 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Dec 20 22:37 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Dec 20 22:37 pg_log
drwxrwxr-x. 2 postgres postgres  6 Dec 20 22:37 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ll backups/
total 0
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$pg_ctl restart -m fast
waiting for server to shut down.... done
server stopped
waiting for server to start....2020-12-20 09:38:08.353 EST [60437] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-12-20 09:38:08.353 EST [60437] LOCATION: PostmasterMain, postmaster.c:998
2020-12-20 09:38:08.358 EST [60437] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-12-20 09:38:08.358 EST [60437] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 09:38:08.358 EST [60437] LOG: 00000: listening on IPv6 address "::", port 5432
2020-12-20 09:38:08.358 EST [60437] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 09:38:08.364 EST [60437] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-12-20 09:38:08.364 EST [60437] LOCATION: StreamServerPort, pqcomm.c:587
2020-12-20 09:38:08.419 EST [60437] LOG: 00000: redirecting log output to logging collector process
2020-12-20 09:38:08.419 EST [60437] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-12-20 09:38:08.419 EST [60437] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman init -B /postgresql/pgsql/pg_rman_backups/
INFO: ARCLOG_PATH is set to '/postgresql/pgsql/archive_log'
INFO: SRVLOG_PATH is set to '/postgresql/pgsql/pg_log'
[postgres@node_206 /postgresql/pgsql]$vim pg_rman_backups/pg_rman.ini 
[postgres@node_206 /postgresql/pgsql]$ll backups/
total 0
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$vim $PGDATA/postgresql.conf
[postgres@node_206 /postgresql/pgsql]$pg_ctl restart -m fast
waiting for server to shut down.... done
server stopped
waiting for server to start....2020-12-20 09:38:08.353 EST [60437] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-12-20 09:38:08.353 EST [60437] LOCATION: PostmasterMain, postmaster.c:998
2020-12-20 09:38:08.358 EST [60437] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-12-20 09:38:08.358 EST [60437] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 09:38:08.358 EST [60437] LOG: 00000: listening on IPv6 address "::", port 5432
2020-12-20 09:38:08.358 EST [60437] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 09:38:08.364 EST [60437] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-12-20 09:38:08.364 EST [60437] LOCATION: StreamServerPort, pqcomm.c:587
2020-12-20 09:38:08.419 EST [60437] LOG: 00000: redirecting log output to logging collector process
2020-12-20 09:38:08.419 EST [60437] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-12-20 09:38:08.419 EST [60437] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman init -B /postgresql/pgsql/pg_rman_backups/
INFO: ARCLOG_PATH is set to '/postgresql/pgsql/archive_log'
INFO: SRVLOG_PATH is set to '/postgresql/pgsql/pg_log'
[postgres@node_206 /postgresql/pgsql]$vim pg_rman_backups/pg_rman.ini 
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql -Upostgres
psql (12.3)
Type "help" for help.
postgres=# \l
                 List of databases
  Name  | Owner  | Encoding |  Collate  |  Ctype  |  Access privileges  
-----------+----------+----------+-------------+-------------+-----------------------
 postgres | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 repmgr  | repmgr  | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 template1 | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | =c/postgres     +
      |     |     |       |       | postgres=CTc/postgres
 test   | postgres | UTF8   | en_US.UTF-8 | en_US.UTF-8 | 
(5 rows)
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# create table test_pg_rman (id int, crt_time timestamp default clock_timestamp());
CREATE TABLE
test=# insert into test_pg_rman (id) select n from generate_series(1,10000) n;
INSERT 0 10000
test=# \q
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
INFO: start deleting old archived WAL files from ARCLOG_PATH (keep days = 10)
INFO: the threshold timestamp calculated by keep days is "2020-12-10 00:00:00"
INFO: start deleting old backup (keep generations = 3 AND keep after = 2020-10-21 00:00:00)
INFO: does not include the backup just taken
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-12-20 22:39:35" backup and archive log files by CRC
INFO: backup "2020-12-20 22:39:35" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$cat pg_rman_backups/*ini
ARCLOG_PATH='/postgresql/pgsql/archive_log'
SRVLOG_PATH='/postgresql/pgsql/pg_log'
COMPRESS_DATA = YES
KEEP_ARCLOG_DAYS = 10
KEEP_DATA_GENERATIONS = 3
KEEP_DATA_DAYS = 60
KEEP_SRVLOG_DAYS = 10
[postgres@node_206 /postgresql/pgsql]$ll /postgresql/pgsql/pg_log/
total 288
-rw-------. 1 postgres postgres 256 Nov 15 17:39 postgresql-2020-11-15_043957.log
-rw-------. 1 postgres postgres 256 Nov 15 18:00 postgresql-2020-11-15_050047.log
-rw-------. 1 postgres postgres 256 Nov 15 18:08 postgresql-2020-11-15_050800.log
-rw-------. 1 postgres postgres  0 Nov 16 13:00 postgresql-2020-11-16_000000.log
-rw-------. 1 postgres postgres 256 Nov 17 07:32 postgresql-2020-11-16_183244.log
-rw-------. 1 postgres postgres 256 Nov 17 07:33 postgresql-2020-11-16_183333.log
-rw-------. 1 postgres postgres 256 Nov 17 09:22 postgresql-2020-11-16_202244.log
-rw-------. 1 postgres postgres 256 Nov 17 09:26 postgresql-2020-11-16_202616.log
-rw-------. 1 postgres postgres 256 Nov 17 09:32 postgresql-2020-11-16_203210.log
-rw-------. 1 postgres postgres  0 Nov 17 13:00 postgresql-2020-11-17_000000.log
-rw-------. 1 postgres postgres 256 Nov 17 16:49 postgresql-2020-11-17_034947.log
-rw-------. 1 postgres postgres 448 Nov 17 17:06 postgresql-2020-11-17_040642.log
-rw-------. 1 postgres postgres 448 Nov 17 17:08 postgresql-2020-11-17_040822.log
-rw-------. 1 postgres postgres 256 Nov 17 17:09 postgresql-2020-11-17_040929.log
-rw-------. 1 postgres postgres 256 Nov 17 17:11 postgresql-2020-11-17_041114.log
-rw-------. 1 postgres postgres 448 Nov 17 17:11 postgresql-2020-11-17_041147.log
-rw-------. 1 postgres postgres 448 Nov 17 17:13 postgresql-2020-11-17_041342.log
-rw-------. 1 postgres postgres 256 Nov 17 17:15 postgresql-2020-11-17_041506.log
-rw-------. 1 postgres postgres 448 Nov 17 17:18 postgresql-2020-11-17_041841.log
-rw-------. 1 postgres postgres 256 Nov 17 17:20 postgresql-2020-11-17_042040.log
-rw-------. 1 postgres postgres 744 Nov 17 17:23 postgresql-2020-11-17_042334.log
-rw-------. 1 postgres postgres 448 Nov 17 17:31 postgresql-2020-11-17_043101.log
-rw-------. 1 postgres postgres 352 Nov 17 17:46 postgresql-2020-11-17_044648.log
-rw-------. 1 postgres postgres 352 Nov 17 17:47 postgresql-2020-11-17_044749.log
-rw-------. 1 postgres postgres 256 Nov 17 17:48 postgresql-2020-11-17_044854.log
-rw-------. 1 postgres postgres 256 Nov 17 18:10 postgresql-2020-11-17_051036.log
-rw-------. 1 postgres postgres 256 Nov 17 18:12 postgresql-2020-11-17_051236.log
-rw-------. 1 postgres postgres 256 Nov 17 18:29 postgresql-2020-11-17_052955.log
-rw-------. 1 postgres postgres 1384 Nov 17 18:32 postgresql-2020-11-17_053216.log
-rw-------. 1 postgres postgres 256 Nov 17 23:25 postgresql-2020-11-17_102510.log
-rw-------. 1 postgres postgres 256 Nov 17 23:27 postgresql-2020-11-17_102736.log
-rw-------. 1 postgres postgres 256 Nov 17 23:32 postgresql-2020-11-17_103209.log
-rw-------. 1 postgres postgres 256 Nov 17 23:34 postgresql-2020-11-17_103402.log
-rw-------. 1 postgres postgres 256 Nov 17 23:34 postgresql-2020-11-17_103422.log
-rw-------. 1 postgres postgres 256 Nov 17 23:36 postgresql-2020-11-17_103641.log
-rw-------. 1 postgres postgres 256 Nov 17 23:45 postgresql-2020-11-17_104513.log
-rw-------. 1 postgres postgres 256 Nov 17 23:53 postgresql-2020-11-17_105341.log
-rw-------. 1 postgres postgres 448 Nov 18 00:00 postgresql-2020-11-17_110030.log
-rw-------. 1 postgres postgres 256 Nov 18 00:00 postgresql-2020-11-17_110051.log
-rw-------. 1 postgres postgres 256 Nov 18 00:01 postgresql-2020-11-17_110130.log
-rw-------. 1 postgres postgres 256 Nov 18 00:08 postgresql-2020-11-17_110826.log
-rw-------. 1 postgres postgres 256 Nov 18 00:14 postgresql-2020-11-17_111446.log
-rw-------. 1 postgres postgres 1136 Nov 18 00:15 postgresql-2020-11-17_111504.log
-rw-------. 1 postgres postgres 256 Nov 18 02:41 postgresql-2020-11-17_134136.log
-rw-------. 1 postgres postgres 256 Nov 18 02:41 postgresql-2020-11-17_134151.log
-rw-------. 1 postgres postgres 256 Nov 17 17:28 postgresql-2020-11-17_172801.log
-rw-------. 1 postgres postgres 256 Nov 17 17:40 postgresql-2020-11-17_174037.log
-rw-------. 1 postgres postgres 256 Nov 17 17:44 postgresql-2020-11-17_174409.log
-rw-------. 1 postgres postgres 560 Nov 17 17:50 postgresql-2020-11-17_175020.log
-rw-------. 1 postgres postgres 560 Nov 17 17:52 postgresql-2020-11-17_175256.log
-rw-------. 1 postgres postgres 360 Nov 17 17:58 postgresql-2020-11-17_175847.log
-rw-------. 1 postgres postgres 256 Nov 17 17:59 postgresql-2020-11-17_175928.log
-rw-------. 1 postgres postgres 360 Nov 17 18:00 postgresql-2020-11-17_180030.log
-rw-------. 1 postgres postgres 360 Nov 17 18:01 postgresql-2020-11-17_180115.log
-rw-------. 1 postgres postgres 256 Nov 17 18:04 postgresql-2020-11-17_180404.log
-rw-------. 1 postgres postgres 360 Nov 17 18:07 postgresql-2020-11-17_180712.log
-rw-------. 1 postgres postgres 360 Nov 17 18:07 postgresql-2020-11-17_180740.log
-rw-------. 1 postgres postgres 360 Nov 17 18:11 postgresql-2020-11-17_181126.log
-rw-------. 1 postgres postgres 360 Nov 17 18:19 postgresql-2020-11-17_181918.log
-rw-------. 1 postgres postgres 256 Nov 17 18:24 postgresql-2020-11-17_182446.log
-rw-------. 1 postgres postgres 256 Nov 17 18:25 postgresql-2020-11-17_182540.log
-rw-------. 1 postgres postgres 256 Nov 17 18:26 postgresql-2020-11-17_182619.log
-rw-------. 1 postgres postgres 256 Nov 17 18:27 postgresql-2020-11-17_182733.log
-rw-------. 1 postgres postgres 256 Nov 17 18:27 postgresql-2020-11-17_182743.log
-rw-------. 1 postgres postgres 256 Nov 17 18:28 postgresql-2020-11-17_182847.log
-rw-------. 1 postgres postgres 256 Nov 17 18:29 postgresql-2020-11-17_182916.log
-rw-------. 1 postgres postgres 256 Nov 17 18:30 postgresql-2020-11-17_183028.log
-rw-------. 1 postgres postgres 256 Nov 17 18:33 postgresql-2020-11-17_183304.log
-rw-------. 1 postgres postgres 256 Nov 17 18:34 postgresql-2020-11-17_183413.log
-rw-------. 1 postgres postgres 256 Nov 17 18:34 postgresql-2020-11-17_183450.log
-rw-------. 1 postgres postgres 256 Nov 17 23:06 postgresql-2020-11-17_230648.log
-rw-------. 1 postgres postgres 256 Nov 17 23:20 postgresql-2020-11-17_232015.log
-rw-------. 1 postgres postgres 256 Dec 20 22:37 postgresql-2020-12-20_093747.log
-rw-------. 1 postgres postgres 256 Dec 20 22:38 postgresql-2020-12-20_093808.log
[postgres@node_206 /postgresql/pgsql]$cat pg_rman_backups/*ini
ARCLOG_PATH='/postgresql/pgsql/archive_log'
SRVLOG_PATH='/postgresql/pgsql/pg_log'
COMPRESS_DATA = YES
KEEP_ARCLOG_DAYS = 10
KEEP_DATA_GENERATIONS = 3
KEEP_DATA_DAYS = 60
KEEP_SRVLOG_DAYS = 10
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL 5451kB  10 OK
[postgres@node_206 /postgresql/pgsql]$psql -d test
psql (12.3)
Type "help" for help.
test=# select count(*) from test_pg_rman ;
 count 
-------
 10000
(1 row)
test=# insert into test_pg_rman (id) select n from generate_series(10001,20000) n;
INSERT 0 10000
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup -bi -B /postgresql/pgsql/pg_rman_backups
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.
INFO: start deleting old archived WAL files from ARCLOG_PATH (keep days = 10)
INFO: the threshold timestamp calculated by keep days is "2020-12-10 00:00:00"
INFO: start deleting old backup (keep generations = 3 AND keep after = 2020-10-21 00:00:00)
INFO: does not include the backup just taken
INFO: backup "2020-12-20 22:39:35" should be kept
DETAIL: This is the 1st latest full backup.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-12-20 22:41:40" backup and archive log files by CRC
INFO: backup "2020-12-20 22:41:40" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR  390kB  10 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL 5451kB  10 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql -U test
psql: error: could not connect to server: FATAL: role "test" does not exist
[postgres@node_206 /postgresql/pgsql]$psql -U postgres -d test
psql (12.3)
Type "help" for help.
test=# truncate test_pg_rman ;
TRUNCATE TABLE
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_ctl stop 
waiting for server to shut down.... done
server stopped
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:39:35'
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:41:40'
INFO: the recovery target timeline ID is not given
INFO: use timeline ID of current database cluster as recovery target: 10
INFO: calculating timeline branches to be used to recovery target point
INFO: searching latest full backup which can be used as restore start point
INFO: found the full backup can be used as base in recovery: "2020-12-20 22:39:35"
INFO: copying online WAL files and server log files
INFO: clearing restore destination
INFO: validate: "2020-12-20 22:39:35" backup and archive log files by SIZE
INFO: backup "2020-12-20 22:39:35" is valid
INFO: restoring database files from the full mode backup "2020-12-20 22:39:35"
INFO: searching incremental backup to be restored
INFO: searching backup which contained archived WAL files to be restored
INFO: backup "2020-12-20 22:39:35" is valid
INFO: restoring WAL files from backup "2020-12-20 22:39:35"
INFO: backup "2020-12-20 22:41:40" is valid
INFO: restoring WAL files from backup "2020-12-20 22:41:40"
INFO: restoring online WAL files and server log files
INFO: add recovery related options to postgresql.conf
INFO: generating recovery.signal
INFO: restore complete
HINT: Recovery will start automatically when the PostgreSQL server is started.
[postgres@node_206 /postgresql/pgsql]$pg_ctl start
waiting for server to start....2020-12-20 09:43:32.516 EST [60584] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-12-20 09:43:32.516 EST [60584] LOCATION: PostmasterMain, postmaster.c:998
2020-12-20 09:43:32.518 EST [60584] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-12-20 09:43:32.518 EST [60584] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 09:43:32.519 EST [60584] LOG: 00000: listening on IPv6 address "::", port 5432
2020-12-20 09:43:32.519 EST [60584] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 09:43:32.520 EST [60584] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-12-20 09:43:32.520 EST [60584] LOCATION: StreamServerPort, pqcomm.c:587
2020-12-20 09:43:32.565 EST [60584] LOG: 00000: redirecting log output to logging collector process
2020-12-20 09:43:32.565 EST [60584] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-12-20 09:43:32.565 EST [60584] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$psql
psql (12.3)
Type "help" for help.
postgres=# select * from pg_is_in_recovery();
 pg_is_in_recovery 
-------------------
 t
(1 row)
postgres=# select pg_wal_replay_resume();
 pg_wal_replay_resume 
----------------------
 
(1 row)
postgres=# select * from pg_is_in_recovery();
 pg_is_in_recovery 
-------------------
 f
(1 row)
postgres=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR  390kB  10 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL 5451kB  10 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_controldata /postgresql/pgsql/data/
pg_control version number:      1201
Catalog version number:        201909212
Database system identifier:      6895281636782426835
Database cluster state:        in production
pg_control last modified:       Sun 20 Dec 2020 10:43:51 PM CST
Latest checkpoint location:      0/86000028
Latest checkpoint's REDO location:  0/86000028
Latest checkpoint's REDO WAL file:  0000000B0000000000000086
Latest checkpoint's TimeLineID:    11
Latest checkpoint's PrevTimeLineID:  10
Latest checkpoint's full_page_writes: on
Latest checkpoint's NextXID:     0:7753
Latest checkpoint's NextOID:     25080
Latest checkpoint's NextMultiXactId: 1
Latest checkpoint's NextMultiOffset: 0
Latest checkpoint's oldestXID:    479
Latest checkpoint's oldestXID's DB:  1
Latest checkpoint's oldestActiveXID: 0
Latest checkpoint's oldestMultiXid:  1
Latest checkpoint's oldestMulti's DB: 1
Latest checkpoint's oldestCommitTsXid:0
Latest checkpoint's newestCommitTsXid:0
Time of latest checkpoint:      Sun 20 Dec 2020 10:43:51 PM CST
Fake LSN counter for unlogged rels:  0/3E8
Minimum recovery ending location:   0/0
Min recovery ending loc's timeline:  0
Backup start location:        0/0
Backup end location:         0/0
End-of-backup record required:    no
wal_level setting:          replica
wal_log_hints setting:        on
max_connections setting:       200
max_worker_processes setting:     8
max_wal_senders setting:       10
max_prepared_xacts setting:      0
max_locks_per_xact setting:      64
track_commit_timestamp setting:    off
Maximum data alignment:        8
Database block size:         8192
Blocks per segment of large relation: 131072
WAL block size:            8192
Bytes per WAL segment:        16777216
Maximum length of identifiers:    64
Maximum columns in an index:     32
Maximum size of a TOAST chunk:    1996
Size of a large-object chunk:     2048
Date/time type storage:        64-bit integers
Float4 argument passing:       by value
Float8 argument passing:       by value
Data page checksum version:      0
Mock authentication nonce:      0e803fe626d0bf49403235ba1f4f8a665eb48d4d847cb7863dcad401e65676ca
[postgres@node_206 /postgresql/pgsql]$ll data/pg_wal/
total 180268
-rw-------. 1 postgres postgres    42 Dec 20 22:43 00000002.history
-rw-------. 1 postgres postgres    85 Dec 20 22:43 00000003.history
-rw-------. 1 postgres postgres   128 Dec 20 22:43 00000004.history
-rw-------. 1 postgres postgres   171 Dec 20 22:43 00000005.history
-rw-------. 1 postgres postgres   216 Dec 20 22:43 00000006.history
-rw-------. 1 postgres postgres   261 Dec 20 22:43 00000007.history
-rw-------. 1 postgres postgres   261 Dec 20 22:43 00000008.history
-rw-------. 1 postgres postgres   304 Dec 20 22:43 00000009.history
-rw-------. 1 postgres postgres   349 Dec 20 22:43 0000000A0000000000000085.00000028.backup
-rw-------. 1 postgres postgres   259 Dec 20 22:43 0000000A.history
-rw-------. 1 postgres postgres 16777216 Dec 20 22:43 0000000B0000000000000086
-rw-------. 1 postgres postgres 16777216 Dec 20 22:43 0000000B0000000000000087
-rw-------. 1 postgres postgres 16777216 Dec 20 22:43 0000000B0000000000000088
-rw-------. 1 postgres postgres 16777216 Dec 20 22:43 0000000B0000000000000089
-rw-------. 1 postgres postgres 16777216 Dec 20 22:43 0000000B000000000000008A
-rw-------. 1 postgres postgres 16777216 Dec 20 22:43 0000000B000000000000008B
-rw-------. 1 postgres postgres 16777216 Dec 20 22:43 0000000B000000000000008C
-rw-------. 1 postgres postgres 16777216 Dec 20 22:43 0000000B000000000000008D
-rw-------. 1 postgres postgres 16777216 Dec 20 22:43 0000000B000000000000008E
-rw-------. 1 postgres postgres 16777216 Dec 20 22:43 0000000B000000000000008F
-rw-------. 1 postgres postgres 16777216 Dec 20 22:43 0000000B0000000000000090
-rw-------. 1 postgres postgres   312 Dec 20 22:43 0000000B.history
drwx------. 2 postgres postgres   233 Dec 20 22:43 archive_status
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql
psql (12.3)
Type "help" for help.
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# select count(*) from test;
 count 
-------
 2000
(1 row)
test=# select count(*) from test_pg_rman ;
 count 
-------
 20000
(1 row)
test=# insert into test_pg_rman (id) select n from generate_series(20001,30000) n;
INSERT 0 10000
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR  390kB  10 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL 5451kB  10 OK
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
INFO: start deleting old archived WAL files from ARCLOG_PATH (keep days = 10)
INFO: the threshold timestamp calculated by keep days is "2020-12-10 00:00:00"
INFO: start deleting old backup (keep generations = 3 AND keep after = 2020-10-21 00:00:00)
INFO: does not include the backup just taken
INFO: backup "2020-12-20 22:41:40" should be kept
DETAIL: This belongs to the 1st latest full backup.
INFO: backup "2020-12-20 22:39:35" should be kept
DETAIL: This is the 1st latest full backup.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-12-20 22:51:24" backup and archive log files by CRC
INFO: backup "2020-12-20 22:51:24" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-12-20 22:51:24 2020-12-20 22:51:27 FULL 6184kB  11 OK
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR  390kB  10 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL 5451kB  10 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_ctl stop
waiting for server to shut down.... done
server stopped
[postgres@node_206 /postgresql/pgsql]$ll
total 32
drwxr-xr-x. 2 postgres postgres 4096 Dec 20 22:51 archive_log
drwxrwxr-x. 2 postgres postgres  6 Nov 17 15:51 backups
drwxr-xr-x. 2 postgres postgres 4096 Nov 17 16:43 bin
drwx------. 19 postgres postgres 4096 Dec 20 22:51 data
drwxr-xr-x. 6 postgres postgres 4096 Nov 15 16:14 include
drwxr-xr-x. 4 postgres postgres 4096 Nov 17 06:37 lib
drwxr-xr-x. 2 postgres postgres 4096 Dec 20 22:43 pg_log
drwxrwxr-x. 5 postgres postgres 104 Dec 20 22:39 pg_rman_backups
drwxr-xr-x. 8 postgres postgres 4096 Nov 15 16:14 share
[postgres@node_206 /postgresql/pgsql]$mv data data_origin
[postgres@node_206 /postgresql/pgsql]$pg_ctl start
pg_ctl: directory "/postgresql/pgsql/data" does not exist
[postgres@node_206 /postgresql/pgsql]$pg_ctl start
pg_ctl: directory "/postgresql/pgsql/data" does not exist
[postgres@node_206 /postgresql/pgsql]$mv data_origin/ data
[postgres@node_206 /postgresql/pgsql]$pg_ctl start
waiting for server to start....2020-12-20 09:52:26.732 EST [60723] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-12-20 09:52:26.732 EST [60723] LOCATION: PostmasterMain, postmaster.c:998
2020-12-20 09:52:26.738 EST [60723] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-12-20 09:52:26.738 EST [60723] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 09:52:26.738 EST [60723] LOG: 00000: listening on IPv6 address "::", port 5432
2020-12-20 09:52:26.738 EST [60723] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 09:52:26.740 EST [60723] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-12-20 09:52:26.740 EST [60723] LOCATION: StreamServerPort, pqcomm.c:587
2020-12-20 09:52:26.791 EST [60723] LOG: 00000: redirecting log output to logging collector process
2020-12-20 09:52:26.791 EST [60723] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-12-20 09:52:26.791 EST [60723] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$psql -U postgres
psql (12.3)
Type "help" for help.
postgres=# drop database test;
DROP DATABASE
postgres=# \q
[postgres@node_206 /postgresql/pgsql]$pg_ctl stop
waiting for server to shut down.... done
server stopped
[postgres@node_206 /postgresql/pgsql]$mv data/ data_origin
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ 
WARNING: pg_controldata file "/postgresql/pgsql/data/global/pg_control" does not exist
INFO: the recovery target timeline ID is not given
INFO: use timeline ID of latest full backup as recovery target: 11
INFO: calculating timeline branches to be used to recovery target point
INFO: searching latest full backup which can be used as restore start point
INFO: found the full backup can be used as base in recovery: "2020-12-20 22:51:24"
INFO: copying online WAL files and server log files
INFO: clearing restore destination
INFO: validate: "2020-12-20 22:51:24" backup and archive log files by SIZE
INFO: backup "2020-12-20 22:51:24" is valid
INFO: restoring database files from the full mode backup "2020-12-20 22:51:24"
INFO: searching incremental backup to be restored
INFO: searching backup which contained archived WAL files to be restored
INFO: backup "2020-12-20 22:51:24" is valid
INFO: restoring WAL files from backup "2020-12-20 22:51:24"
INFO: restoring online WAL files and server log files
INFO: add recovery related options to postgresql.conf
INFO: generating recovery.signal
INFO: restore complete
HINT: Recovery will start automatically when the PostgreSQL server is started.
[postgres@node_206 /postgresql/pgsql]$pg_ctl start
waiting for server to start....2020-12-20 09:53:09.888 EST [60773] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-12-20 09:53:09.888 EST [60773] LOCATION: PostmasterMain, postmaster.c:998
2020-12-20 09:53:09.889 EST [60773] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-12-20 09:53:09.889 EST [60773] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 09:53:09.890 EST [60773] LOG: 00000: listening on IPv6 address "::", port 5432
2020-12-20 09:53:09.890 EST [60773] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 09:53:09.893 EST [60773] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-12-20 09:53:09.893 EST [60773] LOCATION: StreamServerPort, pqcomm.c:587
2020-12-20 09:53:09.947 EST [60773] LOG: 00000: redirecting log output to logging collector process
2020-12-20 09:53:09.947 EST [60773] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-12-20 09:53:09.947 EST [60773] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$psql
psql (12.3)
Type "help" for help.
postgres=# \c test
You are now connected to database "test" as user "postgres".
test=# \dt
      List of relations
 Schema |   Name   | Type | Owner  
--------+--------------+-------+----------
 public | test     | table | postgres
 public | test_pg_rman | table | postgres
(2 rows)
test=# select count(*) from test_pg_Rman;
 count 
-------
 30000
(1 row)
test=# select count(*) from test;
 count 
-------
 2000
(1 row)
test=# 
test=# select * from pg_is_in_recovery();
 pg_is_in_recovery 
-------------------
 t
(1 row)
test=# select pg_wal_replay_resume();
 pg_wal_replay_resume 
----------------------
 
(1 row)
test=# select * from pg_is_in_recovery();
 pg_is_in_recovery 
-------------------
 f
(1 row)
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/
=====================================================================
 StartTime      EndTime       Mode  Size  TLI Status 
=====================================================================
2020-12-20 22:51:24 2020-12-20 22:51:27 FULL 6184kB  11 OK
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR  390kB  10 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL 5451kB  10 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:39:35'
ERROR: PostgreSQL server is running
HINT: Please stop PostgreSQL server before executing restore.
[postgres@node_206 /postgresql/pgsql]$pg_ctl stop
waiting for server to shut down.... done
server stopped
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:39:35'
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:39:36'
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:39:34'
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:39:20'
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:39:24
> ^C
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:39:24'
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:39:24' -P
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:39:24' -P-v
pg_rman: invalid option -- '-'
ERROR: option is not specified
HINT: Try "pg_rman --help" for more information.
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:39:24' -Pv
========================================
restore start
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:39:24' -Pv --debug
========================================
restore start
DEBUG: the current timeline ID of database cluster is 12
ERROR: cannot do restore
DETAIL: There is no valid full backup which can be used for given recovery condition.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/ details
ERROR: arguments are invalid. near "details"
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/ detail
======================================================================================================================
 StartTime      EndTime       Mode  Data ArcLog SrvLog  Total Compressed CurTLI ParentTLI Status 
======================================================================================================================
2020-12-20 22:51:24 2020-12-20 22:51:27 FULL  45MB  117MB  ---- 6184kB    true   11     10 OK
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR 1237kB  33MB  ----  390kB    true   10     0 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL  44MB  33MB  ---- 5451kB    true   10     0 OK
[postgres@node_206 /postgresql/pgsql]$ls
archive_log backups bin data data_origin include lib pg_log pg_rman_backups share
[postgres@node_206 /postgresql/pgsql]$pg_controldata /postgresql/pgsql/data/
pg_control version number:      1201
Catalog version number:        201909212
Database system identifier:      6895281636782426835
Database cluster state:        shut down
pg_control last modified:       Sun 20 Dec 2020 10:54:14 PM CST
Latest checkpoint location:      0/89000028
Latest checkpoint's REDO location:  0/89000028
Latest checkpoint's REDO WAL file:  0000000C0000000000000089
Latest checkpoint's TimeLineID:    12
Latest checkpoint's PrevTimeLineID:  12
Latest checkpoint's full_page_writes: on
Latest checkpoint's NextXID:     0:7755
Latest checkpoint's NextOID:     25080
Latest checkpoint's NextMultiXactId: 1
Latest checkpoint's NextMultiOffset: 0
Latest checkpoint's oldestXID:    479
Latest checkpoint's oldestXID's DB:  1
Latest checkpoint's oldestActiveXID: 0
Latest checkpoint's oldestMultiXid:  1
Latest checkpoint's oldestMulti's DB: 1
Latest checkpoint's oldestCommitTsXid:0
Latest checkpoint's newestCommitTsXid:0
Time of latest checkpoint:      Sun 20 Dec 2020 10:54:14 PM CST
Fake LSN counter for unlogged rels:  0/3E8
Minimum recovery ending location:   0/0
Min recovery ending loc's timeline:  0
Backup start location:        0/0
Backup end location:         0/0
End-of-backup record required:    no
wal_level setting:          replica
wal_log_hints setting:        on
max_connections setting:       200
max_worker_processes setting:     8
max_wal_senders setting:       10
max_prepared_xacts setting:      0
max_locks_per_xact setting:      64
track_commit_timestamp setting:    off
Maximum data alignment:        8
Database block size:         8192
Blocks per segment of large relation: 131072
WAL block size:            8192
Bytes per WAL segment:        16777216
Maximum length of identifiers:    64
Maximum columns in an index:     32
Maximum size of a TOAST chunk:    1996
Size of a large-object chunk:     2048
Date/time type storage:        64-bit integers
Float4 argument passing:       by value
Float8 argument passing:       by value
Data page checksum version:      0
Mock authentication nonce:      0e803fe626d0bf49403235ba1f4f8a665eb48d4d847cb7863dcad401e65676ca
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
ERROR: could not connect to database postgres: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
[postgres@node_206 /postgresql/pgsql]$pg_ctl start
waiting for server to start....2020-12-20 09:56:02.612 EST [60839] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-12-20 09:56:02.612 EST [60839] LOCATION: PostmasterMain, postmaster.c:998
2020-12-20 09:56:02.613 EST [60839] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-12-20 09:56:02.613 EST [60839] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 09:56:02.613 EST [60839] LOG: 00000: listening on IPv6 address "::", port 5432
2020-12-20 09:56:02.613 EST [60839] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 09:56:02.615 EST [60839] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-12-20 09:56:02.615 EST [60839] LOCATION: StreamServerPort, pqcomm.c:587
2020-12-20 09:56:02.664 EST [60839] LOG: 00000: redirecting log output to logging collector process
2020-12-20 09:56:02.664 EST [60839] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-12-20 09:56:02.664 EST [60839] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
INFO: start deleting old archived WAL files from ARCLOG_PATH (keep days = 10)
INFO: the threshold timestamp calculated by keep days is "2020-12-10 00:00:00"
INFO: start deleting old backup (keep generations = 3 AND keep after = 2020-10-21 00:00:00)
INFO: does not include the backup just taken
WARNING: backup "2020-12-20 22:55:57" is not taken into account
DETAIL: This is not a valid backup.
INFO: backup "2020-12-20 22:51:24" should be kept
DETAIL: This is the 1st latest full backup.
INFO: backup "2020-12-20 22:41:40" should be kept
DETAIL: This belongs to the 2nd latest full backup.
INFO: backup "2020-12-20 22:39:35" should be kept
DETAIL: This is the 2nd latest full backup.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/data/ --recovery-target-time='2020-11-18 00:10:49' -A /postgresql/pgsql/archive_log/ -S /postgresql/pgsql/pg_log/
ERROR: could not open file "/postgresql/pgsql/data//pg_rman.ini": No such file or directory
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/ detail
======================================================================================================================
 StartTime      EndTime       Mode  Data ArcLog SrvLog  Total Compressed CurTLI ParentTLI Status 
======================================================================================================================
2020-12-20 22:56:05 2020-12-20 22:56:09 FULL  45MB  201MB  ---- 6251kB    true   12     11 DONE
2020-12-20 22:55:57 2020-12-20 22:55:57 FULL  ----  ----  ----   0B    true    0     0 ERROR
2020-12-20 22:51:24 2020-12-20 22:51:27 FULL  45MB  117MB  ---- 6184kB    true   11     10 OK
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR 1237kB  33MB  ----  390kB    true   10     0 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL  44MB  33MB  ---- 5451kB    true   10     0 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_ctl start
pg_ctl: another server might be running; trying to start server anyway
waiting for server to start....2020-12-20 10:01:14.923 EST [60948] FATAL: F0001: lock file "postmaster.pid" already exists
2020-12-20 10:01:14.923 EST [60948] HINT: Is another postmaster (PID 60839) running in data directory "/postgresql/pgsql/data"?
2020-12-20 10:01:14.923 EST [60948] LOCATION: CreateLockFile, miscinit.c:1034
 stopped waiting
pg_ctl: could not start server
Examine the log output.
[postgres@node_206 /postgresql/pgsql]$psql -U postgres -d test
psql (12.3)
Type "help" for help.
test=# create table test2 (like test);
CREATE TABLE
test=# \d test2
             Table "public.test2"
 Column |      Type       | Collation | Nullable | Default 
----------+-----------------------------+-----------+----------+---------
 id    | integer           |      |     | 
 crt_time | timestamp without time zone |      |     | 
test=# insert into test2 (id ) select n from generate_series(1,1000000) n;
INSERT 0 1000000
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=incremental -B /postgresql/pgsql/pg_rman_backups
INFO: copying database files
ERROR: cannot take an incremental backup
DETAIL: There is no validated full backup with current timeline.
HINT: Please take a full backup and validate it before doing an incremental backup. Or use with --full-backup-on-error command line option.
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
INFO: start deleting old archived WAL files from ARCLOG_PATH (keep days = 10)
INFO: the threshold timestamp calculated by keep days is "2020-12-10 00:00:00"
INFO: start deleting old backup (keep generations = 3 AND keep after = 2020-10-21 00:00:00)
INFO: does not include the backup just taken
WARNING: backup "2020-12-20 23:01:58" is not taken into account
DETAIL: This is not a valid backup.
WARNING: backup "2020-12-20 22:56:05" is not taken into account
DETAIL: This is not a valid backup.
WARNING: backup "2020-12-20 22:55:57" is not taken into account
DETAIL: This is not a valid backup.
INFO: backup "2020-12-20 22:51:24" should be kept
DETAIL: This is the 1st latest full backup.
INFO: backup "2020-12-20 22:41:40" should be kept
DETAIL: This belongs to the 2nd latest full backup.
INFO: backup "2020-12-20 22:39:35" should be kept
DETAIL: This is the 2nd latest full backup.
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-12-20 22:56:05" backup and archive log files by CRC
INFO: backup "2020-12-20 22:56:05" is valid
INFO: validate: "2020-12-20 23:02:07" backup and archive log files by CRC
INFO: backup "2020-12-20 23:02:07" is valid
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/ detail
======================================================================================================================
 StartTime      EndTime       Mode  Data ArcLog SrvLog  Total Compressed CurTLI ParentTLI Status 
======================================================================================================================
2020-12-20 23:02:07 2020-12-20 23:02:13 FULL  82MB  301MB  ----  23MB    true   12     11 OK
2020-12-20 23:01:58 2020-12-20 23:01:58 INCR   0B  ----  ----   0B    true   12     11 ERROR
2020-12-20 22:56:05 2020-12-20 22:56:09 FULL  45MB  201MB  ---- 6251kB    true   12     11 OK
2020-12-20 22:55:57 2020-12-20 22:55:57 FULL  ----  ----  ----   0B    true    0     0 ERROR
2020-12-20 22:51:24 2020-12-20 22:51:27 FULL  45MB  117MB  ---- 6184kB    true   11     10 OK
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR 1237kB  33MB  ----  390kB    true   10     0 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL  44MB  33MB  ---- 5451kB    true   10     0 OK
[postgres@node_206 /postgresql/pgsql]$pg_ctl stop 
waiting for server to shut down.... done
server stopped
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:39:24' -Pv --debug
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:39:24' -Pv 
[postgres@node_206 /postgresql/pgsql]$pg_rman restore -B /postgresql/pgsql/pg_rman_backups/ --recovery-target-time='2020-12-20 22:56:05'
INFO: the recovery target timeline ID is not given
INFO: use timeline ID of current database cluster as recovery target: 12
INFO: calculating timeline branches to be used to recovery target point
INFO: searching latest full backup which can be used as restore start point
INFO: found the full backup can be used as base in recovery: "2020-12-20 22:51:24"
INFO: copying online WAL files and server log files
INFO: clearing restore destination
INFO: validate: "2020-12-20 22:51:24" backup and archive log files by SIZE
INFO: backup "2020-12-20 22:51:24" is valid
INFO: restoring database files from the full mode backup "2020-12-20 22:51:24"
INFO: searching incremental backup to be restored
INFO: searching backup which contained archived WAL files to be restored
INFO: backup "2020-12-20 22:51:24" is valid
INFO: restoring WAL files from backup "2020-12-20 22:51:24"
INFO: backup "2020-12-20 22:56:05" is valid
INFO: restoring WAL files from backup "2020-12-20 22:56:05"
INFO: backup "2020-12-20 23:02:07" is valid
INFO: restoring WAL files from backup "2020-12-20 23:02:07"
INFO: restoring online WAL files and server log files
INFO: add recovery related options to postgresql.conf
INFO: generating recovery.signal
INFO: restore complete
HINT: Recovery will start automatically when the PostgreSQL server is started.
[postgres@node_206 /postgresql/pgsql]$pg_ctl start
waiting for server to start....2020-12-20 10:03:39.933 EST [61032] LOG: 00000: starting PostgreSQL 12.3 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2020-12-20 10:03:39.933 EST [61032] LOCATION: PostmasterMain, postmaster.c:998
2020-12-20 10:03:39.935 EST [61032] LOG: 00000: listening on IPv4 address "0.0.0.0", port 5432
2020-12-20 10:03:39.935 EST [61032] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 10:03:39.936 EST [61032] LOG: 00000: listening on IPv6 address "::", port 5432
2020-12-20 10:03:39.936 EST [61032] LOCATION: StreamServerPort, pqcomm.c:593
2020-12-20 10:03:39.941 EST [61032] LOG: 00000: listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-12-20 10:03:39.941 EST [61032] LOCATION: StreamServerPort, pqcomm.c:587
2020-12-20 10:03:39.982 EST [61032] LOG: 00000: redirecting log output to logging collector process
2020-12-20 10:03:39.982 EST [61032] HINT: Future log output will appear in directory "/postgresql/pgsql/pg_log".
2020-12-20 10:03:39.982 EST [61032] LOCATION: SysLogger_Start, syslogger.c:675
 done
server started
[postgres@node_206 /postgresql/pgsql]$psql -d test
psql (12.3)
Type "help" for help.
test=# \dt
      List of relations
 Schema |   Name   | Type | Owner  
--------+--------------+-------+----------
 public | test     | table | postgres
 public | test_pg_rman | table | postgres
(2 rows)
test=# select pg_wal_replay_resume();
 pg_wal_replay_resume 
----------------------
 
(1 row)
test=# 
test=# select * from pg_is_in_recovery();
 pg_is_in_recovery 
-------------------
 f
(1 row)
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/ detail
======================================================================================================================
 StartTime      EndTime       Mode  Data ArcLog SrvLog  Total Compressed CurTLI ParentTLI Status 
======================================================================================================================
2020-12-20 23:02:07 2020-12-20 23:02:13 FULL  82MB  301MB  ----  23MB    true   12     11 OK
2020-12-20 23:01:58 2020-12-20 23:01:58 INCR   0B  ----  ----   0B    true   12     11 ERROR
2020-12-20 22:56:05 2020-12-20 22:56:09 FULL  45MB  201MB  ---- 6251kB    true   12     11 OK
2020-12-20 22:55:57 2020-12-20 22:55:57 FULL  ----  ----  ----   0B    true    0     0 ERROR
2020-12-20 22:51:24 2020-12-20 22:51:27 FULL  45MB  117MB  ---- 6184kB    true   11     10 OK
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR 1237kB  33MB  ----  390kB    true   10     0 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL  44MB  33MB  ---- 5451kB    true   10     0 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_controldata /postgresql/pgsql/data/
pg_control version number:      1201
Catalog version number:        201909212
Database system identifier:      6895281636782426835
Database cluster state:        in production
pg_control last modified:       Sun 20 Dec 2020 11:03:50 PM CST
Latest checkpoint location:      0/8B000028
Latest checkpoint's REDO location:  0/8B000028
Latest checkpoint's REDO WAL file:  0000000D000000000000008B
Latest checkpoint's TimeLineID:    13
Latest checkpoint's PrevTimeLineID:  12
Latest checkpoint's full_page_writes: on
Latest checkpoint's NextXID:     0:7755
Latest checkpoint's NextOID:     25080
Latest checkpoint's NextMultiXactId: 1
Latest checkpoint's NextMultiOffset: 0
Latest checkpoint's oldestXID:    479
Latest checkpoint's oldestXID's DB:  1
Latest checkpoint's oldestActiveXID: 0
Latest checkpoint's oldestMultiXid:  1
Latest checkpoint's oldestMulti's DB: 1
Latest checkpoint's oldestCommitTsXid:0
Latest checkpoint's newestCommitTsXid:0
Time of latest checkpoint:      Sun 20 Dec 2020 11:03:50 PM CST
Fake LSN counter for unlogged rels:  0/3E8
Minimum recovery ending location:   0/0
Min recovery ending loc's timeline:  0
Backup start location:        0/0
Backup end location:         0/0
End-of-backup record required:    no
wal_level setting:          replica
wal_log_hints setting:        on
max_connections setting:       200
max_worker_processes setting:     8
max_wal_senders setting:       10
max_prepared_xacts setting:      0
max_locks_per_xact setting:      64
track_commit_timestamp setting:    off
Maximum data alignment:        8
Database block size:         8192
Blocks per segment of large relation: 131072
WAL block size:            8192
Bytes per WAL segment:        16777216
Maximum length of identifiers:    64
Maximum columns in an index:     32
Maximum size of a TOAST chunk:    1996
Size of a large-object chunk:     2048
Date/time type storage:        64-bit integers
Float4 argument passing:       by value
Float8 argument passing:       by value
Data page checksum version:      0
Mock authentication nonce:      0e803fe626d0bf49403235ba1f4f8a665eb48d4d847cb7863dcad401e65676ca
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
INFO: start deleting old archived WAL files from ARCLOG_PATH (keep days = 10)
INFO: the threshold timestamp calculated by keep days is "2020-12-10 00:00:00"
INFO: start deleting old backup (keep generations = 3 AND keep after = 2020-10-21 00:00:00)
INFO: does not include the backup just taken
INFO: backup "2020-12-20 23:02:07" should be kept
DETAIL: This is the 1st latest full backup.
WARNING: backup "2020-12-20 23:01:58" is not taken into account
DETAIL: This is not a valid backup.
INFO: backup "2020-12-20 22:56:05" should be kept
DETAIL: This is the 2nd latest full backup.
WARNING: backup "2020-12-20 22:55:57" is not taken into account
DETAIL: This is not a valid backup.
INFO: backup "2020-12-20 22:51:24" should be kept
DETAIL: This is the 3rd latest full backup.
INFO: backup "2020-12-20 22:41:40" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 22:39:35" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/ detail
======================================================================================================================
 StartTime      EndTime       Mode  Data ArcLog SrvLog  Total Compressed CurTLI ParentTLI Status 
======================================================================================================================
2020-12-20 23:04:19 2020-12-20 23:04:25 FULL  45MB  352MB  ----  19MB    true   13     12 DONE
2020-12-20 23:02:07 2020-12-20 23:02:13 FULL  82MB  301MB  ----  23MB    true   12     11 OK
2020-12-20 23:01:58 2020-12-20 23:01:58 INCR   0B  ----  ----   0B    true   12     11 ERROR
2020-12-20 22:56:05 2020-12-20 22:56:09 FULL  45MB  201MB  ---- 6251kB    true   12     11 OK
2020-12-20 22:55:57 2020-12-20 22:55:57 FULL  ----  ----  ----   0B    true    0     0 ERROR
2020-12-20 22:51:24 2020-12-20 22:51:27 FULL  45MB  117MB  ---- 6184kB    true   11     10 OK
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR 1237kB  33MB  ----  390kB    true   10     0 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL  44MB  33MB  ---- 5451kB    true   10     0 OK
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-12-20 23:04:19" backup and archive log files by CRC
INFO: backup "2020-12-20 23:04:19" is valid
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/ detail
======================================================================================================================
 StartTime      EndTime       Mode  Data ArcLog SrvLog  Total Compressed CurTLI ParentTLI Status 
======================================================================================================================
2020-12-20 23:04:19 2020-12-20 23:04:25 FULL  45MB  352MB  ----  19MB    true   13     12 OK
2020-12-20 23:02:07 2020-12-20 23:02:13 FULL  82MB  301MB  ----  23MB    true   12     11 OK
2020-12-20 23:01:58 2020-12-20 23:01:58 INCR   0B  ----  ----   0B    true   12     11 ERROR
2020-12-20 22:56:05 2020-12-20 22:56:09 FULL  45MB  201MB  ---- 6251kB    true   12     11 OK
2020-12-20 22:55:57 2020-12-20 22:55:57 FULL  ----  ----  ----   0B    true    0     0 ERROR
2020-12-20 22:51:24 2020-12-20 22:51:27 FULL  45MB  117MB  ---- 6184kB    true   11     10 OK
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR 1237kB  33MB  ----  390kB    true   10     0 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL  44MB  33MB  ---- 5451kB    true   10     0 OK
[postgres@node_206 /postgresql/pgsql]$psql -d test
psql (12.3)
Type "help" for help.
test=# \dt
      List of relations
 Schema |   Name   | Type | Owner  
--------+--------------+-------+----------
 public | test     | table | postgres
 public | test_pg_rman | table | postgres
(2 rows)
test=# create table test2(like test);
CREATE TABLE
test=# insert into test2 select * from test;
INSERT 0 2000
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup -bi -B /postgresql/pgsql/pg_rman_backups
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.
INFO: start deleting old archived WAL files from ARCLOG_PATH (keep days = 10)
INFO: the threshold timestamp calculated by keep days is "2020-12-10 00:00:00"
INFO: start deleting old backup (keep generations = 3 AND keep after = 2020-10-21 00:00:00)
INFO: does not include the backup just taken
INFO: backup "2020-12-20 23:04:19" should be kept
DETAIL: This is the 1st latest full backup.
INFO: backup "2020-12-20 23:02:07" should be kept
DETAIL: This is the 2nd latest full backup.
WARNING: backup "2020-12-20 23:01:58" is not taken into account
DETAIL: This is not a valid backup.
INFO: backup "2020-12-20 22:56:05" should be kept
DETAIL: This is the 3rd latest full backup.
WARNING: backup "2020-12-20 22:55:57" is not taken int account
DETAIL: This is not valid backup.
INFO: backup "2020-12-20 22:51:24" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 22:41:40" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 22:39:35" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-12-20 23:06:51" backup and archive log files by CRC
INFO: backup "2020-12-20 23:06:51" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/ detail
======================================================================================================================
 StartTime      EndTime       Mode  Data ArcLog SrvLog  Total Compressed CurTLI ParentTLI Status 
======================================================================================================================
2020-12-20 23:06:51 2020-12-20 23:06:53 INCR 2465kB  33MB  ----  112kB    true   13     12 OK
2020-12-20 23:04:19 2020-12-20 23:04:25 FULL  45MB  352MB  ----  19MB    true   13     12 OK
2020-12-20 23:02:07 2020-12-20 23:02:13 FULL  82MB  301MB  ----  23MB    true   12     11 OK
2020-12-20 23:01:58 2020-12-20 23:01:58 INCR   0B  ----  ----   0B    true   12     11 ERROR
2020-12-20 22:56:05 2020-12-20 22:56:09 FULL  45MB  201MB  ---- 6251kB    true   12     11 OK
2020-12-20 22:55:57 2020-12-20 22:55:57 FULL  ----  ----  ----   0B    true    0     0 ERROR
2020-12-20 22:51:24 2020-12-20 22:51:27 FULL  45MB  117MB  ---- 6184kB    true   11     10 OK
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR 1237kB  33MB  ----  390kB    true   10     0 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL  44MB  33MB  ---- 5451kB    true   10     0 OK
[postgres@node_206 /postgresql/pgsql]$psql -d test
psql (12.3)
Type "help" for help.
test=# create table test34(like test);
CREATE TABLE
test=# create table test3(like test);
CREATE TABLE
test=# insert into test3 select * from test;
INSERT 0 2000
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
INFO: start deleting old archived WAL files from ARCLOG_PATH (keep days = 10)
INFO: the threshold timestamp calculated by keep days is "2020-12-10 00:00:00"
INFO: start deleting old backup (keep generations = 3 AND keep after = 2020-10-21 00:00:00)
INFO: does not include the backup just taken
INFO: backup "2020-12-20 23:06:51" should be kept
DETAIL: This belongs to the 1st latest full backup.
INFO: backup "2020-12-20 23:04:19" should be kept
DETAIL: This is the 1st latest full backup.
INFO: backup "2020-12-20 23:02:07" should be kept
DETAIL: This is the 2nd latest full backup.
WARNING: backup "2020-12-20 23:01:58" is not taken into account
DETAIL: This is not a valid backup.
INFO: backup "2020-12-20 22:56:05" should be kept
DETAIL: This is the 3rd latest full backup.
WARNING: backup "2020-12-20 22:55:57" is not taken int account
DETAIL: This is not valid backup.
INFO: backup "2020-12-20 22:51:24" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 22:41:40" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 22:39:35" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-12-20 23:08:23" backup and archive log files by CRC
INFO: backup "2020-12-20 23:08:23" is valid
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/ detail
======================================================================================================================
 StartTime      EndTime       Mode  Data ArcLog SrvLog  Total Compressed CurTLI ParentTLI Status 
======================================================================================================================
2020-12-20 23:08:23 2020-12-20 23:08:25 FULL  46MB  33MB  ---- 5495kB    true   13     12 OK
2020-12-20 23:06:51 2020-12-20 23:06:53 INCR 2465kB  33MB  ----  112kB    true   13     12 OK
2020-12-20 23:04:19 2020-12-20 23:04:25 FULL  45MB  352MB  ----  19MB    true   13     12 OK
2020-12-20 23:02:07 2020-12-20 23:02:13 FULL  82MB  301MB  ----  23MB    true   12     11 OK
2020-12-20 23:01:58 2020-12-20 23:01:58 INCR   0B  ----  ----   0B    true   12     11 ERROR
2020-12-20 22:56:05 2020-12-20 22:56:09 FULL  45MB  201MB  ---- 6251kB    true   12     11 OK
2020-12-20 22:55:57 2020-12-20 22:55:57 FULL  ----  ----  ----   0B    true    0     0 ERROR
2020-12-20 22:51:24 2020-12-20 22:51:27 FULL  45MB  117MB  ---- 6184kB    true   11     10 OK
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR 1237kB  33MB  ----  390kB    true   10     0 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL  44MB  33MB  ---- 5451kB    true   10     0 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql -d test
psql (12.3)
Type "help" for help.
test=# creat table test4(like test);
ERROR: syntax error at or near "creat"
LINE 1: creat table test4(like test);
    ^
test=# create table test4(like test);
CREATE TABLE
test=# insert into test4 select * from test;
INSERT 0 2000
test=# 
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
INFO: start deleting old archived WAL files from ARCLOG_PATH (keep days = 10)
INFO: the threshold timestamp calculated by keep days is "2020-12-10 00:00:00"
INFO: start deleting old backup (keep generations = 3 AND keep after = 2020-10-21 00:00:00)
INFO: does not include the backup just taken
INFO: backup "2020-12-20 23:08:23" should be kept
DETAIL: This is the 1st latest full backup.
INFO: backup "2020-12-20 23:06:51" should be kept
DETAIL: This belongs to the 2nd latest full backup.
INFO: backup "2020-12-20 23:04:19" should be kept
DETAIL: This is the 2nd latest full backup.
INFO: backup "2020-12-20 23:02:07" should be kept
DETAIL: This is the 3rd latest full backup.
WARNING: backup "2020-12-20 23:01:58" is not taken int account
DETAIL: This is not valid backup.
INFO: backup "2020-12-20 22:56:05" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
WARNING: backup "2020-12-20 22:55:57" is not taken int account
DETAIL: This is not valid backup.
INFO: backup "2020-12-20 22:51:24" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 22:41:40" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 22:39:35" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-12-20 23:09:48" backup and archive log files by CRC
INFO: backup "2020-12-20 23:09:48" is valid
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/ detail
======================================================================================================================
 StartTime      EndTime       Mode  Data ArcLog SrvLog  Total Compressed CurTLI ParentTLI Status 
======================================================================================================================
2020-12-20 23:09:48 2020-12-20 23:09:50 FULL  46MB  33MB  ---- 5507kB    true   13     12 OK
2020-12-20 23:08:23 2020-12-20 23:08:25 FULL  46MB  33MB  ---- 5495kB    true   13     12 OK
2020-12-20 23:06:51 2020-12-20 23:06:53 INCR 2465kB  33MB  ----  112kB    true   13     12 OK
2020-12-20 23:04:19 2020-12-20 23:04:25 FULL  45MB  352MB  ----  19MB    true   13     12 OK
2020-12-20 23:02:07 2020-12-20 23:02:13 FULL  82MB  301MB  ----  23MB    true   12     11 OK
2020-12-20 23:01:58 2020-12-20 23:01:58 INCR   0B  ----  ----   0B    true   12     11 ERROR
2020-12-20 22:56:05 2020-12-20 22:56:09 FULL  45MB  201MB  ---- 6251kB    true   12     11 OK
2020-12-20 22:55:57 2020-12-20 22:55:57 FULL  ----  ----  ----   0B    true    0     0 ERROR
2020-12-20 22:51:24 2020-12-20 22:51:27 FULL  45MB  117MB  ---- 6184kB    true   11     10 OK
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR 1237kB  33MB  ----  390kB    true   10     0 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL  44MB  33MB  ---- 5451kB    true   10     0 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql -d test
psql (12.3)
Type "help" for help.
test=# create table test5(like test);
CREATE TABLE
test=# insert into test5 select * from test;
INSERT 0 2000
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup --backup-mode=full -B /postgresql/pgsql/pg_rman_backups
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.
INFO: start deleting old archived WAL files from ARCLOG_PATH (keep days = 10)
INFO: the threshold timestamp calculated by keep days is "2020-12-10 00:00:00"
INFO: start deleting old backup (keep generations = 3 AND keep after = 2020-10-21 00:00:00)
INFO: does not include the backup just taken
INFO: backup "2020-12-20 23:09:48" should be kept
DETAIL: This is the 1st latest full backup.
INFO: backup "2020-12-20 23:08:23" should be kept
DETAIL: This is the 2nd latest full backup.
INFO: backup "2020-12-20 23:06:51" should be kept
DETAIL: This belongs to the 3rd latest full backup.
INFO: backup "2020-12-20 23:04:19" should be kept
DETAIL: This is the 3rd latest full backup.
INFO: backup "2020-12-20 23:02:07" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
WARNING: backup "2020-12-20 23:01:58" is not taken int account
DETAIL: This is not valid backup.
INFO: backup "2020-12-20 22:56:05" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
WARNING: backup "2020-12-20 22:55:57" is not taken int account
DETAIL: This is not valid backup.
INFO: backup "2020-12-20 22:51:24" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 22:41:40" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 22:39:35" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-12-20 23:10:12" backup and archive log files by CRC
INFO: backup "2020-12-20 23:10:12" is valid
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/ detail
======================================================================================================================
 StartTime      EndTime       Mode  Data ArcLog SrvLog  Total Compressed CurTLI ParentTLI Status 
======================================================================================================================
2020-12-20 23:10:12 2020-12-20 23:10:14 FULL  46MB  33MB  ---- 5520kB    true   13     12 OK
2020-12-20 23:09:48 2020-12-20 23:09:50 FULL  46MB  33MB  ---- 5507kB    true   13     12 OK
2020-12-20 23:08:23 2020-12-20 23:08:25 FULL  46MB  33MB  ---- 5495kB    true   13     12 OK
2020-12-20 23:06:51 2020-12-20 23:06:53 INCR 2465kB  33MB  ----  112kB    true   13     12 OK
2020-12-20 23:04:19 2020-12-20 23:04:25 FULL  45MB  352MB  ----  19MB    true   13     12 OK
2020-12-20 23:02:07 2020-12-20 23:02:13 FULL  82MB  301MB  ----  23MB    true   12     11 OK
2020-12-20 23:01:58 2020-12-20 23:01:58 INCR   0B  ----  ----   0B    true   12     11 ERROR
2020-12-20 22:56:05 2020-12-20 22:56:09 FULL  45MB  201MB  ---- 6251kB    true   12     11 OK
2020-12-20 22:55:57 2020-12-20 22:55:57 FULL  ----  ----  ----   0B    true    0     0 ERROR
2020-12-20 22:51:24 2020-12-20 22:51:27 FULL  45MB  117MB  ---- 6184kB    true   11     10 OK
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR 1237kB  33MB  ----  390kB    true   10     0 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL  44MB  33MB  ---- 5451kB    true   10     0 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql -d test
psql (12.3)
Type "help" for help.
test=# create table test5(like test);
ERROR: relation "test5" already exists
test=# create table test6(like test);
CREATE TABLE
test=# insert into test6 select * from test;
INSERT 0 2000
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup -bi -B /postgresql/pgsql/pg_rman_backups
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.
INFO: start deleting old archived WAL files from ARCLOG_PATH (keep days = 10)
INFO: the threshold timestamp calculated by keep days is "2020-12-10 00:00:00"
INFO: start deleting old backup (keep generations = 3 AND keep after = 2020-10-21 00:00:00)
INFO: does not include the backup just taken
INFO: backup "2020-12-20 23:10:12" should be kept
DETAIL: This is the 1st latest full backup.
INFO: backup "2020-12-20 23:09:48" should be kept
DETAIL: This is the 2nd latest full backup.
INFO: backup "2020-12-20 23:08:23" should be kept
DETAIL: This is the 3rd latest full backup.
INFO: backup "2020-12-20 23:06:51" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 23:04:19" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 23:02:07" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
WARNING: backup "2020-12-20 23:01:58" is not taken int account
DETAIL: This is not valid backup.
INFO: backup "2020-12-20 22:56:05" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
WARNING: backup "2020-12-20 22:55:57" is not taken int account
DETAIL: This is not valid backup.
INFO: backup "2020-12-20 22:51:24" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 22:41:40" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 22:39:35" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-12-20 23:12:23" backup and archive log files by CRC
INFO: backup "2020-12-20 23:12:23" is valid
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/ detail
======================================================================================================================
 StartTime      EndTime       Mode  Data ArcLog SrvLog  Total Compressed CurTLI ParentTLI Status 
======================================================================================================================
2020-12-20 23:12:23 2020-12-20 23:12:25 INCR 2621kB  33MB  ----  140kB    true   13     12 OK
2020-12-20 23:10:12 2020-12-20 23:10:14 FULL  46MB  33MB  ---- 5520kB    true   13     12 OK
2020-12-20 23:09:48 2020-12-20 23:09:50 FULL  46MB  33MB  ---- 5507kB    true   13     12 OK
2020-12-20 23:08:23 2020-12-20 23:08:25 FULL  46MB  33MB  ---- 5495kB    true   13     12 OK
2020-12-20 23:06:51 2020-12-20 23:06:53 INCR 2465kB  33MB  ----  112kB    true   13     12 OK
2020-12-20 23:04:19 2020-12-20 23:04:25 FULL  45MB  352MB  ----  19MB    true   13     12 OK
2020-12-20 23:02:07 2020-12-20 23:02:13 FULL  82MB  301MB  ----  23MB    true   12     11 OK
2020-12-20 23:01:58 2020-12-20 23:01:58 INCR   0B  ----  ----   0B    true   12     11 ERROR
2020-12-20 22:56:05 2020-12-20 22:56:09 FULL  45MB  201MB  ---- 6251kB    true   12     11 OK
2020-12-20 22:55:57 2020-12-20 22:55:57 FULL  ----  ----  ----   0B    true    0     0 ERROR
2020-12-20 22:51:24 2020-12-20 22:51:27 FULL  45MB  117MB  ---- 6184kB    true   11     10 OK
2020-12-20 22:41:40 2020-12-20 22:41:43 INCR 1237kB  33MB  ----  390kB    true   10     0 OK
2020-12-20 22:39:35 2020-12-20 22:39:37 FULL  44MB  33MB  ---- 5451kB    true   10     0 OK
[postgres@node_206 /postgresql/pgsql]$
[postgres@node_206 /postgresql/pgsql]$psql -d test
psql (12.3)
Type "help" for help.
test=# create table test7(like test);
CREATE TABLE
test=# insert into test7 select * from test;
INSERT 0 2000
test=# \q
[postgres@node_206 /postgresql/pgsql]$pg_rman backup -bf -B /postgresql/pgsql/pg_rman_backups
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.
INFO: start deleting old archived WAL files from ARCLOG_PATH (keep days = 10)
INFO: the threshold timestamp calculated by keep days is "2020-12-10 00:00:00"
INFO: start deleting old backup (keep generations = 3 AND keep after = 2020-10-21 00:00:00)
INFO: does not include the backup just taken
INFO: backup "2020-12-20 23:12:23" should be kept
DETAIL: This belongs to the 1st latest full backup.
INFO: backup "2020-12-20 23:10:12" should be kept
DETAIL: This is the 1st latest full backup.
INFO: backup "2020-12-20 23:09:48" should be kept
DETAIL: This is the 2nd latest full backup.
INFO: backup "2020-12-20 23:08:23" should be kept
DETAIL: This is the 3rd latest full backup.
INFO: backup "2020-12-20 23:06:51" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 23:04:19" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 23:02:07" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
WARNING: backup "2020-12-20 23:01:58" is not taken int account
DETAIL: This is not valid backup.
INFO: backup "2020-12-20 22:56:05" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
WARNING: backup "2020-12-20 22:55:57" is not taken int account
DETAIL: This is not valid backup.
INFO: backup "2020-12-20 22:51:24" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 22:41:40" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
INFO: backup "2020-12-20 22:39:35" should be kept
DETAIL: This is taken after "2020-10-21 00:00:00".
[postgres@node_206 /postgresql/pgsql]$pg_rman validate -B /postgresql/pgsql/pg_rman_backups
INFO: validate: "2020-12-20 23:12:47" backup and archive log files by CRC
INFO: backup "2020-12-20 23:12:47" is valid
[postgres@node_206 /postgresql/pgsql]$pg_rman show -B /postgresql/pgsql/pg_rman_backups/ detail
======================================================================================================================
 StartTime      EndTime       Mode  Data ArcLog SrvLog  Total Compressed CurTLI ParentTLI Status 
======================================================================================================================
2020-12-20 23:12:47 2020-12-20 23:12:50 FULL  46MB  33MB  ---- 5546kB    true   13     12 OK
2020-12-20 23:12:23 2020-12-20 23:12:25 INCR 2621kB  33MB  ----  140kB    true   13     12 OK
2020-12-20 23:10:12 2020-12-20 23:10:14 FULL  46MB  33MB  ---- 5520kB    true   13     12 OK
2020-12-20 23:09:48 2020-12-20 23:09:50 FULL  46MB  33MB  ---- 5507kB    true   13     12 OK
2020-12-20 23:08:23 2020-12-20 23:08:25 FULL  46MB  33MB  ---- 5495kB    true   13     12 OK
2020-12-20 23:06:51 2020-12-20 23:06:53 INCR 2465kB  33MB  ----  112kB    true   13     12 OK
2020-12-20 23:04:19 2020-12-20 23:04:25 FULL  45MB  352MB  ----  19MB    true   13     12 OK

總結

在 基于時間點恢復時, 如果之前做過恢復,那么此時DB與之前的備份已經不在同一時間線上。恢復默認只沿著基礎備份建立時時間線恢復而不會切換到新的時間線,如果不做處理,恢復結果將和前面的完整恢復一模一樣,恢復不出新插入的數據, 所以建議在恢復之后,可以接著做一個全庫的備份

恢復之后, 數據庫可能處于 read-only狀態,此時可以用超戶執行select pg_wal_replay_resume(); 或者在啟動數據庫實例前在postgresql.conf中添加recovery_target_action=‘promote'

pg_rman init 之后會生產 pg_rman.ini文件, 此時可以編輯該文件并添加備份策略,

我們以一個例子來說明:總共保留兩周的數據,即14天的數據,每周進行一次全備,每周一和周三的2:00做一次增量備份,每天進行一次歸檔備份,這樣我們需要對pg_rman.init中做如下配置:

KEEP_DATA_GENERATIONS=2
KEEP_DATA_DAYS=14
KEEP_ARCLOG_DAYS=15
KEEP_SRVLOG_DAYS=180

因為我們需要兩個全備份,所以KEEP_DATA_GENERATIONS=2

兩周的數據所以KEEP_DATA_DAYS=14,而可以把WAL日志多保留一天,所以KEEP_ARCLOG_DAYS=15

至少保留1000個WAL文件,每個WAL為16M,所以大約16G,占用空間不算大。

KEEP_SRVLOG_DAYS=180,通常程序日志不太,所以保留180天的日志,即3個月。

建議備份時添加參數 -C -Z

建議恢復時添加參數–hard-copy

如果沒有指定這個參數,pg_rman實際上是把在歸檔目錄中建一個軟鏈接 指向恢復中要用到的WAL日志文件。如果指定了這個參數,則執行真的拷貝。

過程中遇到的問題

Linux 系統時間與 PG 中的時間不一致

解決方法:

rm -f /etc/localtime
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

以上為個人經驗,希望能給大家一個參考,也希望大家多多支持腳本之家。如有錯誤或未考慮完全的地方,望不吝賜教。

您可能感興趣的文章:
  • PostgreSQL 查看表的主外鍵等約束關系詳解
  • PostgreSQL中enable、disable和validate外鍵約束的實例
  • postgresql 中的序列nextval詳解
  • PostgreSQL 序列綁定字段與不綁定字段的區別說明
  • PostgreSQL 添加各種約束語法的操作

標簽:溫州 昭通 榆林 寶雞 濮陽 海西 杭州 辛集

巨人網絡通訊聲明:本文標題《PostgreSQL物理備份恢復之 pg_rman的用法說明》,本文關鍵詞  PostgreSQL,物理,備份,恢復,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《PostgreSQL物理備份恢復之 pg_rman的用法說明》相關的同類信息!
  • 本頁收集關于PostgreSQL物理備份恢復之 pg_rman的用法說明的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 佛山市中牌机械有限公司| 张家港市旺巴巴机械有限公司| 厦门东亚机械有限公司| 正扬电子机械有限公司| 北京液压机械有限公司| 东莞市峰茂机械设备有限公司 | 湖北机械设备有限公司| 莱州市华弘机械有限公司| 河北宏发机械有限公司| 山东润通机械制造有限公司| 张家港市旺巴巴机械有限公司 | 明辉机械设备制造有限公司| 济南金胜星机械设备有限公司| 东莞鸿昌机械有限公司| 安阳市机械有限公司| 昆山翔固机械有限公司| 西安金力特机械设备有限公司 | 东莞市千岛机械制造有限公司 | 徐工随车起重机有限公司| 新乡市起重机有限公司| 青岛隆硕农牧机械制造有限公司 | 吉林牧神机械有限公司| 宁波佳尔灵气动机械有限公司| 上海拓稳机械有限公司| 安徽机械设备有限公司| 上海皆力机械设备有限公司| 襄阳东昇机械有限公司| 常州杭钢卓信机械装备有限公司 | 沈阳水泥机械有限公司| 张家口中煤嘉益机械制造有限公司 | 广州市通风机械设备有限公司| 安阳斯普机械有限公司| 渡边食品机械有限公司| 河南 工程机械有限公司| 东莞巨冈机械有限公司| 青岛日川精密机械有限公司| 河南豫工机械有限公司| 广州新欧机械有限公司| 浙江嘉益机械有限公司| 潍坊爱地植保机械有限公司| 江阴乐帕克智能机械有限公司| 上海机械进出口有限公司| 武汉中粮机械有限公司| 大连盘起工业有限公司| 河南郑州机械有限公司| 常州包装机械有限公司| 山鑫机械制造有限公司| 浙江超洋机械有限公司| 青岛鲁耕农业机械有限公司 | 南海区机械设备有限公司| 东莞市泽源机械有限公司| 建湖县液压机械有限公司| 温州市日力轻工机械有限公司| 南京凯驰机械有限公司| 曲阜艾特机械有限公司| 昆山精密机械有限公司| 深圳美鹏机械设备有限公司| 河南隧通机械有限公司| 成都市机械有限公司| 佛山市柯田包装机械有限公司| 广州冠浩机械设备有限公司| 郑州米格机械有限公司| 江苏江南起重机械有限公司| 盐城市丰特铸造机械有限公司| 绵阳新晨动力机械有限公司| 大洋食品机械有限公司| 嘉兴格鲁博机械有限公司| 沈阳重工机械有限公司| 杭州瑞东机械有限公司| 招远华丰机械设备有限公司| 广东韶关钢铁有限公司| 南京巴蜀机械有限公司| 山东包装机械有限公司| 广州永胜钢铁制品有限公司| 东莞恒力机械有限公司| 浙江晟达机械有限公司| 无锡通用起重运输机械有限公司| 大连滨海起重机吊具有限公司| 无锡锡南机械有限公司| 杭州亿安机械设备有限公司| 北京精密机械有限公司| 泰州机械制造有限公司| 顺德富华工程机械制造有限公司| 新晨动力机械有限公司| 广东正力精密机械有限公司| 浙江南山传动机械有限公司| 郑州同鼎机械设备有限公司| 唐山鑫杭钢铁有限公司| 东莞元渝机械有限公司| 亚德林机械有限公司| 东莞正扬电子机械有限公司怎么样| 东莞市日东超声波机械有限公司| 山东华准机械有限公司| 旭能机械制造有限公司| 起重机械制造有限公司| 益阳中源钢铁有限公司| 青州汇众机械有限公司| 徐州川一工程机械有限公司| 张家港港龙机械有限公司| 佛山机械制造有限公司| 中山艾能机械有限公司| 湖北机械制造有限公司| 山东泰安机械有限公司| 台州博州机械有限公司| 郴州粮油机械有限公司| 佛山市永盛达机械有限公司| 新乡矿山起重机有限公司| 南京金城机械有限公司| 新疆 机械有限公司| 常州万高机械制造有限公司| 中山 机械有限公司| 北京机械设备制造有限公司| 华群数控机械有限公司| 南通国盛精密机械有限公司| 鸿达机械制造有限公司| 德州机械制造有限公司| 上海辰品食品机械有限公司| 汤阴升达机械有限公司| 河北政博机械制造有限公司| 上海御流包装机械有限公司| 宝鸡中车时代工程机械有限公司| 山西 重工有限公司| 山东泰峰起重设备制造有限公司| 重型机械制造有限公司| 浙江机械设备制造有限公司| 浙江山海机械有限公司| 中山市凌宇机械有限公司| 劲源机械设备有限公司| 北京恒机械设备有限公司| 徐州智茸工程机械有限公司| 云南中天机械有限公司| 襄阳博亚机械有限公司| 常州欧鹰焊割机械有限公司| 湖南 机械设备有限公司| 东阳机械设备制造有限公司| 上海钢铁物资有限公司| 威斯特机械有限公司| 大丰 机械有限公司| 海安机械制造有限公司| 杭州中力机械设备有限公司| 湖北江重机械制造有限公司 | 章丘市宇龙机械有限公司| 成都富江机械制造有限公司| 上海翊特机械有限公司| 河北明芳钢铁有限公司| 天津大强钢铁有限公司| 佛山市万为包装机械有限公司 | 徐州随车起重机有限公司| 无锡通用机械厂有限公司| 东莞市全永机械制造有限公司| 江阴兴澄特种钢铁有限公司| 焦作巨航粮油机械有限公司 | 大连机械设备有限公司| 南通棉花机械有限公司| 汕头机械有限公司招聘| 济南金梭机械制造有限公司| 上海泓阳机械有限公司| 伟拓压铸机械有限公司| 山东钢铁日照钢铁有限公司| 苏州鹏丰机械元件有限公司| 杭州迪迪机械有限公司| 厦门市机械有限公司| 唐山 机械设备有限公司| 莒县长运机械有限公司| 东莞市金联吹塑机械有限公司| 宁波伟隆传动机械有限公司| 广东南牧机械设备有限公司| 宁波博信机械制造有限公司| 浙江速成精密机械有限公司| 盐城市鑫益达精密机械有限公司 | 高臻机械机械有限公司| 苏州博杰思达机械有限公司 | 无锡市江益液压机械成套有限公司 | 中海福陆重工有限公司招聘| 江苏华雕机械有限公司| 大连 起 有限公司| 潍坊机械制造有限公司| 永川海通机械有限公司| 江苏舜天机械进出口有限公司| 昆山圣源机械有限公司| 起航中文小说有限公司| 常州机械设备有限公司| 浙江建机起重机械有限公司| 余姚 机械 有限公司| 芜湖 机械有限公司| 湘东化工机械有限公司| 环保机械制造有限公司| 金坛包装机械有限公司| 宿迁百通机械有限公司| 中原圣起起重机械有限公司| 宝 重工机械有限公司| 杭州杭顺机械有限公司| 匹思通机械有限公司| 新华机械制造有限公司| 山矿机械设备有限公司| 江阴市博越机械有限公司| 湖北昌胜机械设备制造有限公司| 南通江华机械有限公司| 河南东起机械有限公司| 新乡高服机械有限公司| 山东起重机械有限公司| 泰安嘉和重工机械有限公司| 天津亨旺机械有限公司| 珠海裕丰钢铁有限公司| 张家港 机械有限公司| 宝鸡万工机械制造有限公司| 如东宏信机械制造有限公司| 北京城建重工有限公司| 常州市龙鑫化工机械有限公司| 佳木斯佳联收获机械有限公司| 深圳市海德精密机械有限公司 | 上海应晓食品机械有限公司| 深圳市高郭氏精密机械有限公司| 河北实阳机械有限公司| 高峰机械工业有限公司| 湖南民和重工机械有限公司| 上海傣纬机械设备有限公司| 创宝包装机械有限公司| 上海高敦精密机械有限公司| 潍坊机械设备有限公司| 南京钢铁联合有限公司| 泰安海松机械有限公司| 宁波敏达机械有限公司| 潍坊市通用机械有限公司| 铭诚机械制造有限公司| 鼎泰盛机械有限公司| 上海中吉机械制造有限公司| 徐州徐工基础工程机械有限公司 | 无锡远方机械有限公司| 江 诚机械有限公司| 桐乡 机械有限公司| 广州市赛思达机械设备有限公司 | 浙江齐鲤机械有限公司| 宁波金记机械有限公司| 宣城市建林机械有限公司| 无锡大昌机械工业有限公司| 苏州联又机械有限公司| 山东元裕机械有限公司| 苏州工业园区机械有限公司| 义乌联动机械有限公司| 朝阳重工机械有限公司| 上海松井机械有限公司| 舟山荣德机械有限公司| 上海申越包装机械制造有限公司 | 常德机械制造有限公司| 郑州重型机械有限公司| 永裕昌机械有限公司| 烨隆精密机械有限公司| 起帆电线电缆有限公司| 鑫成机械设备有限公司| 亿佰通机械有限公司| 南通安港机械有限公司| 广州普耐柯数控机械有限公司| 江苏奥马机械有限公司| 广西南宁机械有限公司| 柳州富达机械有限公司官网| 台州通宇变速机械有限公司| 襄阳东昇机械有限公司| 东莞市日东超声波机械有限公司| 江苏盐城机械有限公司| 常州新燎原机械有限公司| 威海行雨化工机械有限公司| 深圳海邻机械设备有限公司| 三川德青工程机械有限公司| 江西柳工机械设备有限公司| 常州倍安特动力机械有限公司| 江苏骏马压路机械有限公司| 常州万高机械制造有限公司| 世创机械制造有限公司| 河南省起重机有限公司| 肯拉铎机械有限公司| 上海乾享机械设备有限公司 | 贵州红林机械有限公司| 北京雄伟京发机械加工有限公司| 金达机械制造有限公司| 韶关核力重工机械有限公司| 杭州冠浩机械设备有限公司 | 邢台远大机械制造有限公司| 深圳市硕方精密机械有限公司| 山东问云机械有限公司| 昆山铭世特精密机械有限公司| 青岛德盛机械制造有限公司| 宝鸡南车时代工程机械有限公司 | 江苏民生重工有限公司| 塑料包装机械有限公司| 广东富华机械装备制造有限公司| 山东平安工程机械有限公司| 杭州金丰机械有限公司| 上海凡贝机械有限公司| 石嘴山钢铁有限公司| 青岛中华宇塑料机械有限公司 | 上海景林包装机械有限公司| 上海利昆机械有限公司| 浙江兄弟包装机械有限公司| 南京宏伟屠宰机械制造有限公司| 杭州兴达机械有限公司| 无锡伊诺特石化机械设备有限公司 | 山推楚天工程机械有限公司| 河南星光机械有限公司| 威海光威精密机械有限公司| 唐山荣程钢铁有限公司| 广州市机械有限公司| 宁波液压机械有限公司| 嘉兴机械设备有限公司| 东莞信易电热机械有限公司| 汉虹精密机械有限公司| 东方传动机械有限公司| 宣城 机械 有限公司| 江苏锐成机械有限公司| 河北华昌机械设备有限公司| 上海北阅机械设备有限公司| 宁波科鼎钢铁有限公司| 志高机械有限公司官网| 金鹰重型工程机械有限公司| 新乡振动机械有限公司| 无锡金比机械有限公司| 深圳市塑胶机械有限公司| 上海善佳机械设备有限公司| 佛山市科机械有限公司| 济南新思路机械设备有限公司| 品龙精工机械有限公司| 无锡纺织机械有限公司| 广州晶冠机械有限公司| 佛山松川机械设备有限公司| 合浦惠利机械有限公司| 湖北江重机械制造有限公司| 中意机械苏州有限公司| 上海钦典机械制造有限公司 | 绍兴金江机械有限公司| 广东力丰机械制造有限公司| 济南腾越机械制造有限公司| 上海东蒙路桥机械有限公司| 贵州红林机械有限公司| 杭州纳源传动机械有限公司| 烟台飞达机械设备有限公司| 郑州华隆机械制造有限公司| 威海汇鑫化工机械有限公司| 上海达和荣艺包装机械有限公司| 苏州凯尔博精密机械有限公司| 山东莱德机械有限公司| 曲阜圣达机械有限公司| 泉州佳升机械有限公司| 大连机械制造有限公司| 长春泰盟机械制造有限公司| 临沂盛德机械有限公司| 上海齐耀重工有限公司| 上海液压机械有限公司| 舞钢中加钢铁有限公司| 郑州市昌利机械制造有限公司 | 襄阳博亚机械有限公司| 村田机械上海有限公司| 深圳龙润彩印机械设备有限公司| 南通申通机械有限公司| 常州耐强传动机械有限公司| 山东工大机械有限公司| 三门峡机械有限公司| 金丰机械工业有限公司| 江苏洪流化工机械有限公司| 昆山来运机械设备有限公司| 佛山突破机械制造有限公司| 建湖县液压机械有限公司| 华泰机械制造有限公司| 燕拓航(北京)真空机械有限公司| 大连滨海起重机吊具有限公司| 河北宏川机械制造有限公司| 烟台飞达机械设备有限公司| 浙江高达机械有限公司| 中实洛阳重型机械有限公司实习报告| 盐城联鑫钢铁有限公司| 深圳市鑫台铭机械设备有限公司| 深圳塑胶机械有限公司| 机械维修 有限公司| 上海石化机械制造有限公司| 杭州胜驰机械有限公司| 东莞市鸿铭机械有限公司| 机械装备制造有限公司| 中山凌宇机械有限公司| 常熟机械制造有限公司| 江苏韩通船舶重工有限公司 | 三一汽车起重机械有限公司| 标准缝纫机菀坪机械有限公司| 常州曼恩机械有限公司| 唐山印刷机械有限公司| 青岛昌源隆纺织机械有限公司| 涂装机械设备有限公司| 浙江自力机械有限公司| 江苏锐成机械有限公司| 上海光塑机械制造有限公司 | 台湾正河源机械配件有限公司| 德实机械平湖有限公司| 温岭永进机械有限公司| 温州市润新机械制造有限公司| 上海化工机械厂有限公司| 广东华鼎机械有限公司| 烟台精越达机械设备有限公司| 河北敬业钢铁有限公司| 益丰泰机械有限公司| 青岛如隆机械有限公司| 浙江华天机械有限公司| 兴业机械设备有限公司| 宁波机械设备有限公司| 台州中茂机械有限公司| 上海圣起包装机械有限公司| 保定锐腾机械制造有限公司| 武汉苏源机械设备租赁有限公司 | 山东通用机械有限公司| 杭州中力机械有限公司| 蚌埠柳工机械有限公司| 温州光明印刷机械有限公司| 广州市旭朗机械设备有限公司| 东莞宏品智能机械有限公司| 广东龙辉基业建筑机械有限公司| 广州德晟机械有限公司| 江阴市博越机械有限公司| 苏州动力机械有限公司| 中山精密机械有限公司| 唐山宏润钢铁有限公司| 金纬机械常州有限公司| 福建泉成机械有限公司| 龙口旭鑫机械有限公司| 重庆屯茂机械有限公司| 郑州 食品机械有限公司| 广东粤东机械实业有限公司| 河南千里马工程机械有限公司| 江苏恩纳斯重工机械有限公司| 深圳中施机械设备有限公司| 广州市磊蒙机械设备有限公司| 海益机械配件有限公司| 昆山联德精密机械有限公司| 南京登峰起重设备制造有限公司 | 新鹏辉钢铁有限公司| 博兴县钢铁有限公司| 温州 轻工机械有限公司| 杭州武林机械有限公司| 中泰机械设备有限公司| 杭州容瑞机械技术有限公司| 成都固特机械有限公司| 广州机械租赁有限公司| 机械有限公司怎么注册| 聊城 机械有限公司| 南通奥普机械工程有限公司| 邯郸纺织机械有限公司| 马鞍山市机械有限公司| 济南捷迈数控机械有限公司| 广州金宗机械有限公司| 山东鲁成起重机械有限公司| 广东 机械设备有限公司| 湖南汇一制药机械有限公司| 郑州新水工机械有限公司| 青岛兴机械有限公司| 汇大机械制造有限公司| 重庆龙建机械有限公司| 山东巨明机械有限公司| 广东三浦重工有限公司| 沧州华众煤矿机械有限公司| 唐山燕山钢铁有限公司| 河南信联重工机械有限公司| 深圳市神田机械设备有限公司| 东莞丰堡精密机械有限公司| 烟台金土源机械化工程有限公司 | 济南科华机械有限公司| 唐山市德龙钢铁有限公司| 郑州华郑机械有限公司| 自贡机械制造有限公司| 唐山国义钢铁有限公司| 南京腾阳机械有限公司| 烟台建筑机械有限公司| 宿迁百通机械有限公司| 新昌县蓝翔机械有限公司| 荣精密机械有限公司| 泰富重工制造有限公司| 厦门市机械有限公司| 上海泓阳机械有限公司| 山东胜亚机械有限公司| 矿山机械制造有限公司| 福建泉工机械有限公司| 无锡美高帝机械有限公司| 天津金都钢铁有限公司| 镇江鸿泰钢铁有限公司| 中交天和机械设备制造有限公司| 河北唐银钢铁有限公司| 济南蓝象数控机械有限公司| 山西翔天钢铁有限公司| 德州仁信印染机械有限公司| 咸阳联合机械有限公司| 上海祎飞机械有限公司| 徐州液压机械制造有限公司| 东莞市新望包装机械有限公司| 镇江斯伊格机械有限公司| 珠海精密机械有限公司| 湖南博长钢铁贸易有限公司| 温岭永进机械有限公司| 山西建龙钢铁有限公司地址| 河北展利机械有限公司| 山东恒基钢铁有限公司| 苏州安特精密机械有限公司| 河北实阳机械有限公司| 洛阳耿力机械有限公司| 重庆科邦机械有限公司| 常州制药机械有限公司| 台州启运机械有限公司| 海顺机械台州有限公司| 威海行雨化工机械有限公司| 威海汇鑫化工机械有限公司| 浙江齐鲤机械有限公司| 河北明芳钢铁有限公司| 上海树新机械有限公司| 中实洛阳重型机械有限公司实习报告| 江门携成机械有限公司怎样| 天津大强钢铁有限公司| 广州坚诺机械设备有限公司| 德州石油机械有限公司| 浙江冠林机械有限公司| 广州市旭朗机械设备有限公司| 宁波敏达机械有限公司| 科达机械制造有限公司| 上海腾迈机械有限公司| 苏州诚亚机械有限公司| 聊城日发纺织机械有限公司| 格润德机械制造有限公司| 洛阳易高机械有限公司| 武汉机械工程有限公司| 河南机械制造有限公司| 上海玖钲机械设备有限公司| 兰州兴元钢铁有限公司| 山东泰瑞汽车机械电器有限公司 | 江苏巨风机械制造有限公司| 上海丰泽机械有限公司| 江阴市祥达机械制造有限公司| 上海松仕机械设备有限公司| 玉环中本机械有限公司| 山东兖州煤矿机械有限公司| 常州创领机械有限公司| 湖北鄂重重型机械有限公司| 江阴市江顺机械有限公司| 上海宏铭纺织机械有限公司 | 北京京民兴机械设备有限公司| 河南小松工程机械有限公司| 三一汽车起重机械有限公司| 斗山工程机械苏州有限公司| 苏州恒迈精密机械有限公司| 浙江鼎力机械有限公司| 江阴惠尔信机械有限公司| 常州久压久机械制造有限公司| 北京机械施工有限公司| 南京利德盛机械有限公司 | 南通国盛精密机械有限公司| 新华起重工具有限公司| 东莞钰腾机械有限公司| 萨驰华辰机械 苏州 有限公司| 潍坊大众机械有限公司| 有限公司名字起名大全| 随州市恒大机械铸造有限公司| 上海高敦精密机械有限公司| 合肥成龙钢铁有限公司| 藏不起服饰有限公司| 山东中悦钢铁有限公司| 重庆信鼎精密机械有限公司| 富伟精密机械有限公司| 佛山市中牌机械有限公司| 巩义市机械有限公司| 温岭市大众精密机械有限公司| 沧州怡和机械有限公司| 江苏先电机械有限公司| 油机机械工业有限公司| 山东泰安煤矿机械有限公司| 河北展利机械有限公司| 龙口富元机械有限公司| 兰溪永丰机械有限公司| 温州宇英机械有限公司| 沈阳维用精密机械有限公司| 浙江路杰机械有限公司| 苏州奥德机械有限公司| 苏州起重机械有限公司| 利星行机械有限公司| 山东瀚业机械有限公司| 银三环机械有限公司| 济南华飞数控机械有限公司| 徐州市机械有限公司| 昆山精工机械有限公司| 青岛鑫泉塑料机械有限公司| 南皮县中顺环保机械有限公司| 台湾精密机械有限公司| 嘉兴机械制造有限公司| 佛山市钲昌机械设备有限公司| 昆山施耐特机械有限公司| 青岛沃隆花生机械有限公司| 常州恒力机械有限公司| 河南重工机械有限公司| 广州南头机械有限公司| 石家庄美迪机械有限公司 | 三莲机械制造有限公司| 浙江雄鹏机械有限公司| 顺德机械设备有限公司| 上海美捷伦包装机械有限公司| 中泰机械设备有限公司| 江阴市科盛机械有限公司| 输送机械制造有限公司| 江苏省南扬机械制造有限公司| 常州英来机械有限公司| 河北雪龙机械制造有限公司| 江苏贝斯特数控机械有限公司 | 江苏 机械制造有限公司| 武汉食品机械有限公司| 合肥二宫机械有限公司| 浙江鼎力机械有限公司| 山西中阳钢铁有限公司| 新乡市特昌振动机械有限公司| 江苏华澄重工有限公司| 中安重工自动化装备有限公司 | 南通苏诺特包装机械有限公司 | 上海德采包装机械有限公司| 建筑机械租赁有限公司| 小松山推工程机械有限公司| 山东日发纺织机械有限公司| 杭州机械设备制造有限公司| 广州日森机械有限公司| 浙江万能弹簧机械有限公司| 杭州贝克机械有限公司| 宿迁 机械 有限公司| 山西贝斯特机械制造有限公司| 山东隆盛钢铁有限公司| 矿山起重机有限公司| 诸城市安泰机械有限公司| 江阴惠尔信机械有限公司| 龙口旭鑫机械有限公司| 东莞英豪机械有限公司| 昆明机械制造有限公司| 山东山工机械有限公司| 福建巨邦机械有限公司| 浙江长江机械有限公司| 烟台精越达机械设备有限公司| 食品有限公司起名大全| 福建省晋江市和盛机械有限公司| 石家庄机械设备有限公司| 杭州力泰起重机械有限公司| 机械有限公司 南丰| 东莞市佐臣自动化机械有限公司| 中核天津机械有限公司| 诸城市机械有限公司| 浙江双子机械制造有限公司 | 青岛美克精密机械有限公司| 广东仕诚塑料机械有限公司| 柳州欧维姆机械有限公司| 重庆力劲机械有限公司| 沈阳 机械 有限公司| 东莞钰腾机械有限公司| 中天印刷机械有限公司| 温州海翔机械有限公司| 上海精机械设备有限公司| 杭州嘉诚机械有限公司| 鸿达机械制造有限公司| 仙游东亚机械有限公司| 江苏长强钢铁有限公司| 广东烨辉钢铁有限公司| 郑州天龙机械有限公司| 华天机械制造有限公司| 珠海华亚机械有限公司| 天津国际机械有限公司| 嘉善远景机械有限公司| 杭州川禾机械有限公司| 东莞市佐臣自动化机械有限公司 | 重庆江峰机械有限公司| 南通精密机械有限公司| 安徽远鸿机械自动化有限公司| 江苏苏能机械有限公司| 藏不起服饰有限公司| 昆山乙盛机械有限公司招聘启事| 上海曼中机械有限公司| 中航国际钢铁贸易有限公司| 上海丁博重工机械有限公司| 青岛山森机械有限公司| 永腾弹簧机械设备有限公司| 河南省起重机有限公司| 东莞市岛精机械有限公司| 济南新思路机械设备有限公司| 沂南县宏发机械有限公司| 广东重工监理有限公司| 新昌华亿机械有限公司| 河南万杰食品机械有限公司| 动力机械制造有限公司| 天津钢铁销售有限公司| 上海普顺机械电器制造有限公司| 天津中核机械有限公司| 河北新利钢铁有限公司| 汕头 机械有限公司招聘| 浙江帅锋精密机械制造有限公司| 唐山宏润钢铁有限公司| 辽宁天一重工有限公司| 深圳市鑫台铭机械设备有限公司 | 浙江瑞德森机械有限公司| 江苏科力机械有限公司| 上海定盛机械有限公司| 大连 起 有限公司| 无锡机械制造有限公司| 无锡液压机械有限公司| 东莞市泽冠机械有限公司 | 佛山市晶菱玻璃机械有限公司| 广州金本机械设备有限公司| 苏州联佳精密机械有限公司| 山东峻峰起重机械有限公司| 杭州速能机械有限公司| 无锡振华机械有限公司| 江苏中热机械设备有限公司怎么样| 自动化机械设备有限公司| 河北文丰钢铁有限公司| 江阴市联拓重工机械有限公司| 东莞市联顺机械有限公司| 宁波将军机械有限公司| 上海爱德夏机械有限公司| 英侨机械制造有限公司| 上海展焱包装机械有限公司 | 柳州市宏华机械有限公司| 浙江风驰机械有限公司| 浙江兴发机械有限公司| 台湾正河源机械配件有限公司| 浙江亿森机械有限公司| 江阴宏达机械有限公司| 嵊州市机械有限公司| 湖南卓迪机械有限公司| 苏州市丰科精密机械有限公司| 襄阳亚舟重型工程机械有限公司 | 宁波博信机械制造有限公司 | 山东钢铁贸易有限公司| 杭州冠浩机械设备有限公司| 青岛青工机械有限公司| 河南千里马工程机械有限公司 | 合肥中达机械制造有限公司| 重庆晨翔机械有限公司| 信易电热机械有限公司| 广东光信机械有限公司| 江苏金韦尔机械有限公司| 枣庄金正钢铁有限公司| 黄山市机械有限公司| 贝纳特机械有限公司| 工程机械租赁有限公司| 无锡大昌机械工业有限公司| 临西中伟机械有限公司| 佛山市精密机械有限公司| 陆丰机械郑州有限公司| 上海机械实业有限公司| 宁波壬鼎机械有限公司| 山东机械铸造有限公司| 汉邦机械制造有限公司| 沃得农业机械有限公司| 厦门银华机械有限公司| 河北巨牛机械有限公司| 江苏天宇机械有限公司| 江苏凌特精密机械有限公司 | 武汉精密机械有限公司| 上海 包装机械 有限公司| 宁波辉旺机械有限公司| 邢台机械轧辊有限公司| 延边金科食品机械有限公司| 合肥润通工程机械有限公司| 常州铭盈包装机械有限公司 | 萨克米机械有限公司| 张家口中煤嘉益机械制造有限公司| 兴世机械制造有限公司| 上海臣轩机械有限公司| 金泰机械制造有限公司| 矿山机械制造有限公司| 河南卫华起重机有限公司| 泸州益鑫钢铁有限公司| 长沙益广制药机械有限公司| 日照港达船舶重工有限公司| 输送机械制造有限公司| 芜湖机械制造有限公司| 利勃海尔机械大连有限公司 | 泰安正阳机械有限公司| 天津起重机械有限公司| 上海德机械设备有限公司| 苏州英维特精密机械有限公司| 天津工程机械有限公司| 上海德托机械有限公司| 中施机械设备有限公司| 制药机械设备有限公司| 成都包装机械有限公司| 浙江红旗机械有限公司| 广东信昌机械有限公司| 威海坤豪机械有限公司| 宁波塑料机械有限公司| 济南液压机械有限公司| 辽宁中冶石化机械有限公司| 昆山塑料机械有限公司| 杭州金鸥机械有限公司| 上海汉 机械有限公司| 上海红重机械装备有限公司| 深圳市安格斯机械有限公司| 易百通机械有限公司| 温岭市林大机械有限公司| 河南小松工程机械有限公司 | 盐城中热机械有限公司| 云南中天机械有限公司| 唐山亚捷机械有限公司| 江阴精力机械有限公司| 南通液压机械有限公司| 山东巨明机械有限公司| 东元精密机械有限公司| 山东兴田机械有限公司| 韶瑞重工有限公司招聘| 海益机械配件有限公司| 东莞市鼎祥通用机械设备有限公司 | 天津蓝科机械有限公司| 长葛市机械有限公司| 福建起然燃气设备有限公司 | 江西神起信息技术有限公司| 河北迪森机械制造有限公司 | 河南千里马工程机械有限公司 | 盐城三益石化机械有限公司| 青岛欧普机械设备有限公司| 重庆渝辉机械有限公司| 江苏机械设备制造有限公司| 东莞市从创机械有限公司| 联程机械宁波有限公司| 山东起重机械有限公司| 旭生机械深圳有限公司| 杭州双龙机械有限公司| 苏州精密机械有限公司| 上海汉 机械有限公司| 佳木斯佳联收获机械有限公司 | 上海御流包装机械有限公司 | 武汉瑞威特机械有限公司| 山东兖州煤矿机械有限公司| 星光传动机械有限公司| 中海福陆重工有限公司招聘| 上海齐耀重工有限公司| 华群数控机械有限公司| 张家港市塑机械有限公司| 金达机械制造有限公司| 精密机械配件有限公司| 上海长江服装机械有限公司| 广州市机械有限公司| 德耐尔压缩机械有限公司| 台州农业机械有限公司| 郑州世纪精信机械制造有限公司 | 新乡市豫新起重机械有限公司| 宣城 机械 有限公司| 上海瑞阳机械有限公司| 北京龙泰机械设备安装有限公司| 四川青城机械有限公司| 广州磊蒙机械设备有限公司| 泰安机械有限公司招聘| 北京建筑机械有限公司| 苏州朗威电子机械有限公司| 浙江昌亨机械有限公司| 青岛重工机械有限公司| 山东泰山机械有限公司| 昆明呈钢钢铁有限公司| 青岛华磊塑料机械有限公司| 郑州双狮粮油机械有限公司| 无锡布勒机械制造有限公司招聘| 亿佰通机械有限公司| 山东烨辉钢铁有限公司| 山东和晟机械设备有限公司 | 广州海缔机械有限公司| 安瑞科气体机械有限公司| 河北宏川机械制造有限公司| 四川机械设备有限公司| 福建机械设备有限公司| 江阴派格机械设备有限公司| 山东贝特起重机有限公司| 保定向阳航空精密机械有限公司| 上海精密机械有限公司| 山东山鼎工程机械有限公司| 福建敏捷机械有限公司| 温州朝隆纺织机械有限公司| 苏州海盛精密机械有限公司怎么样| 重庆培柴机械制造有限公司| 辽宁天亿机械有限公司| 陀曼精密机械有限公司| 长江液压机械有限公司| 华电重工装备有限公司| 武汉钢铁有限公司疫情| 浙江双畅起重机械有限公司| 东莞市台铭数控机械有限公司| 福建三宝钢铁有限公司| 上海沁艾机械设备有限公司| 浙江顺得机械有限公司| 临工金利机械有限公司| 江苏柯恒石化电力机械有限公司| 机械(上海)有限公司| 济宁山矿机械有限公司| 新乡 筛分机械有限公司| 鸿达机械设备有限公司| 青岛永强木工机械有限公司| 机械化工工程有限公司| 福建海源机械有限公司| 济南液压机械有限公司| 济南达润机械有限公司| 山东达普机械制造有限公司| 输送机械设备有限公司| 安徽远鸿机械自动化有限公司| 上海泓阳机械有限公司| 上海乾承机械设备有限公司| 济南 建筑机械有限公司| 衡阳华意机械有限公司| 东莞市金拓机械有限公司| 唐山市德龙钢铁有限公司| 无锡兆立精密机械有限公司 | 威马农业机械有限公司| 江苏科圣化工机械有限公司| 山东海宏重工有限公司| 徐州丰展机械有限公司| 天盛机械制造有限公司| 山东威海机械有限公司| 常州自力化工机械有限公司| 北京明日之星玻璃机械有限公司| 焦作市机械制造有限公司| 三门峡机械有限公司| 苏州毕特富精密机械有限公司 | 江苏中圣机械制造有限公司| 湖南卓迪机械有限公司| 长沙聚邦机械设备有限公司| 沧州卓鑫机械设备制造有限公司 | 泸州长江工程机械成套有限公司 | 新乡市豫新起重机械有限公司| 江苏佳粮机械有限公司| 青岛大牧人机械有限公司| 昆山弘迪精密机械有限公司| 张家港港龙机械有限公司| 福州展志钢铁有限公司| 泉州宝隆机械有限公司| 日发纺织机械有限公司| 南京 机械制造有限公司| 中船重工环境工程有限公司怎么样 | 佛山市陶瓷机械有限公司| 青岛雷沃工程机械有限公司| 宁江精密机械有限公司| 山东川普机械有限公司| 四川晶工机械有限公司| 山东博远重工有限公司| 南京化工机械有限公司| 山东山推工程机械结构件有限公司 | 上海小虎机械有限公司| 山东云光钢铁有限公司| 成都经纬机械制造有限公司| 佛山市创利宝包装机械有限公司 | 山东金成机械有限公司| 唐山化工机械有限公司| 萨克米机械有限公司| 杭州建泰机械有限公司| 新乡市特昌振动机械有限公司| 宁波必沃纺织机械有限公司| 瑞安市方泰机械有限公司| 建荣精密机械有限公司| 建湖县液压机械有限公司| 爱可机械深圳有限公司| 江苏瀚皋机械有限公司| 纽科伦起重机有限公司| 江苏大津重工有限公司| 木工机械设备有限公司| 济南机械制造有限公司| 合肥市春华起重机械有限公司 | 上海 乐 机械有限公司| 上海奉业包装机械有限公司| 上海陆达包装机械制造有限公司| 成都弘邦机械有限公司| 佛山市钲昌机械设备有限公司| 滁州富达机械电子有限公司| 北京京西重工有限公司| 济宁鑫宏工矿机械设备有限公司| 宁夏天地奔牛银起设备有限公司| 威马农业机械有限公司| 昆山市升达机械制造有限公司| 温州 轻工机械有限公司| 江苏新瑞机械有限公司| 浙江宇丰机械有限公司| 芜湖汇丰机械工业有限公司| 洛阳重工机械有限公司| 海顺机械台州有限公司| 鹰普机械宜兴有限公司| 邯郸市机械有限公司| 宁波固奇包装机械制造有限公司| 山西风源机械制造有限公司| 浙江欣炜机械有限公司| 奥通机械制造有限公司| 河北清大环保机械有限公司| 苏州宇钻机械有限公司| 山东永健机械有限公司| 深圳市德润机械有限公司| 河南黎明路桥重工有限公司| 太原 机械 有限公司| 永兴机械设备有限公司| 兖州大华机械有限公司| 首唐宝生钢铁有限公司| 上海新沪机械有限公司| 广东 机械设备有限公司| 济南森华精密机械有限公司| 郑州鼎盛机械有限公司| 大唐机械制造有限公司| 韶关核力重工机械有限公司| 温州市春来包装机械有限公司| 广东 钢铁 有限公司| 昆山圣源机械有限公司| 浙江美格机械有限公司| 河南胜飞石油机械有限公司| 焦作市虹起制动器有限公司| 珠海康信精密机械有限公司 |