02.03. Tablespaces


   <<< Back   Next >>>
1. Information about tablespace
psql> \db+ 

2. Detailed information about the tablespace in the backup
[barman@barman-bcp]$ barman list-backup pg-db01

3. Detailed information about the tablespace in the last backup
[barman@barman-bcp]$ barman show-backup pg-db01 20220717T174153


4. Restore database with tablespaces
[barman@barman-bcp ~]$ 
barman recover --remote-ssh-command "ssh postgres@pg-db01" pg-db01 20220717T174711 /srv/postgres/data/14/


5. Start database
[root]# systemctl start postgresql-14.service

6. Restore in different directory structure as of backup database
[barman@barman-bcp ~]$
mkdir /u02/data01 /u02/data02 /u02/data03
chmod 700 /u02/data01 /u02/data02 /u02/data03
barman recover --tablespace data01:/u02/data01 --tablespace data02:/u02/data02 --tablespace data04:/u02/data04 --remote-ssh-command "ssh postgres@pg-db01" pg-db01 20220717T174711 /srv/postgres/data/14/


   <<< Back   Next >>>

No comments:

Post a Comment