Boa tarde pessoal,
Fiz um teste de recuperação e tive alguns problemas na restauração de uma
base, vou tentar fazer um cronograma para mostrar o que foi realizado e ver
se alguém me aponta se houve alguma falha.
1) Foi realizado um pg_start_backup: [2013-05-07 15:44:56 BRT 10.15.60.233]
postgres@postgres LOG: statement: SELECT pg_start_backup('my_backup');
2) O backup encerrou normalmente: [2013-05-07 18:24:01 BRT 10.15.60.233]
postgres@postgres LOG: statement: SELECT pg_stop_backup();
3) Peguei a cópia da base de dados
4) Peguei a cópia dos logs transacionais
5) Limpei o pg_xlog
6) Configurei o recovery.conf
7) Iniciei a restauração
8) Ele restaurou o banco sem erros e mostrou que foi restaurado até 01:01
(horário que foi parado o banco) mesmo eu pedindo até as 03:00, como
esperado.
Problema, na restauração ao invés de ser aplicado os logs apartir do inicio
do pg_start_backup() (arquivo 00000001000002FD000000E6) ele iniciou a
aplicação dos logs a partir do pg_stop_backup() (00000001000002FE00000004)
e ficou um buraco na base entre o inicio do backup e o final.
OBS: server_version |
8.3.9 | Shows the server version.
Seguem os logs:
----------------- arquivo do backup
root@chico:/bkp/postgres/restore# less
00000001000002FD000000E6.00000020.backup
START WAL LOCATION: 2FD/E6000020 (file 00000001000002FD000000E6)
STOP WAL LOCATION: 2FE/4889878 (file 00000001000002FE00000004)
CHECKPOINT LOCATION: 2FD/E6C12B68
START TIME: 2013-05-07 15:46:47 BRT
LABEL: my_backup
STOP TIME: 2013-05-07 18:24:01 BRT
----------------- log da restauração
[2013-05-08 03:39:26 BRT] @ LOG: database system was interrupted; last
known up at 2013-05-07 18:22:19 BRT
[2013-05-08 03:39:26 BRT] @ LOG: starting archive recovery
[2013-05-08 03:39:26 BRT] @ LOG: restore_command = 'cp /pg/archive/%f %p'
[2013-05-08 03:39:26 BRT] @ LOG: recovery_target_time = '2013-05-08
03:09:01-03'
[2013-05-08 03:39:26 BRT] @ LOG: restored log file
"00000001000002FE00000004" from archive
[2013-05-08 03:39:26 BRT] @ LOG: automatic recovery in progress
[2013-05-08 03:39:26 BRT] @ LOG: redo starts at 2FE/402B740
[2013-05-08 03:39:27 BRT] @ LOG: restored log file
"00000001000002FE00000005" from archive
[2013-05-08 03:39:27 BRT] @ LOG: restored log file
"00000001000002FE00000006" from archive
[2013-05-08 03:39:27 BRT] @ LOG: restored log file
"00000001000002FE00000007" from archive
[2013-05-08 03:39:28 BRT] @ LOG: restored log file
"00000001000002FE00000008" from archive
[2013-05-08 03:39:28 BRT] @ LOG: restored log file
"00000001000002FE00000009" from archive
[2013-05-08 03:39:29 BRT] @ LOG: restored log file
"00000001000002FE0000000A" from archive
[2013-05-08 03:39:29 BRT] @ LOG: restored log file
"00000001000002FE0000000B" from archive
[2013-05-08 03:39:29 BRT] @ LOG: restored log file
"00000001000002FE0000000C" from archive
[2013-05-08 03:39:30 BRT] @ LOG: restored log file
"00000001000002FE0000000D" from archive
[2013-05-08 03:39:30 BRT] @ LOG: restored log file
"00000001000002FE0000000E" from archive
[2013-05-08 03:39:30 BRT] @ LOG: restored log file
"00000001000002FE0000000F" from archive
[2013-05-08 03:39:30 BRT] @ LOG: restored log file
"00000001000002FE00000010" from archive
[2013-05-08 03:39:31 BRT] @ LOG: restored log file
"00000001000002FE00000011" from archive
[2013-05-08 03:39:31 BRT] @ LOG: restored log file
"00000001000002FE00000012" from archive
[2013-05-08 03:39:32 BRT] @ LOG: restored log file
"00000001000002FE00000013" from archive
[2013-05-08 03:39:32 BRT] @ LOG: restored log file
"00000001000002FE00000014" from archive
[2013-05-08 03:39:32 BRT] @ LOG: restored log file
"00000001000002FE00000015" from archive
[2013-05-08 03:39:33 BRT] @ LOG: restored log file
"00000001000002FE00000016" from archive
[2013-05-08 03:39:33 BRT] @ LOG: restored log file
"00000001000002FE00000017" from archive
[2013-05-08 03:39:33 BRT] @ LOG: restored log file
"00000001000002FE00000018" from archive
[2013-05-08 03:39:34 BRT] @ LOG: restored log file
"00000001000002FE00000019" from archive
[2013-05-08 03:39:34 BRT] @ LOG: restored log file
"00000001000002FE0000001A" from archive
[2013-05-08 03:39:35 BRT] @ LOG: restored log file
"00000001000002FE0000001B" from archive
[2013-05-08 03:39:35 BRT] @ LOG: restored log file
"00000001000002FE0000001C" from archive
[2013-05-08 03:39:35 BRT] @ LOG: restored log file
"00000001000002FE0000001D" from archive
[2013-05-08 03:39:36 BRT] @ LOG: restored log file
"00000001000002FE0000001E" from archive
cp: cannot stat `/pg/archive/00000001000002FE0000001F': No such file or
directory
[2013-05-08 03:39:36 BRT] @ LOG: could not open file
"pg_xlog/00000001000002FE0000001F" (log file 766, segment 31): No such file
or directory
[2013-05-08 03:39:36 BRT] @ LOG: redo done at 2FE/1EFFED68
[2013-05-08 03:39:36 BRT] @ LOG: last completed transaction was at log
time 2013-05-08 01:01:07.736879-03
[2013-05-08 03:39:36 BRT] @ LOG: restored log file
"00000001000002FE0000001E" from archive
[2013-05-08 03:39:36 BRT] @ LOG: selected new timeline ID: 2
[2013-05-08 03:39:36 BRT] @ LOG: archive recovery complete
[2013-05-08 03:39:40 BRT] @ LOG: database system is ready to accept
connections
Grato,
Francisco Summa
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral