-bash-4.1$ pg_rman backup --backup-mode=full
INFO: database backup start
NOTICE: pg_stop_backup complete, all required WAL segments have been archived
-bash-4.1$ pg_rman backup --backup-mode=incremental --with-serverlog
INFO: database backup start
ERROR: There is no validated full backup with current timeline.Please take a full backup and validate it before doing an incremental backup.
NOTICE: pg_stop_backup complete, all required WAL segments have been archived
-bash-4.1$ pg_rman backup --backup-mode=archive --with-serverlog
-bash-4.1$ pg_rman show -a
============================================================================
Start Time Total Data WAL Log Backup Status
============================================================================
2015-06-25 02:42:26 0m ---- ---- 184MB 2047B 299kB DONE
2015-06-25 02:41:00 0m ---- 0B ---- ---- 0B ERROR
2015-06-25 02:37:36 0m 411MB ---- 134MB ---- 32MB DONE
2015-06-25 01:25:22 0m ---- ---- 33MB 0B 53kB OK
2015-06-25 01:25:11 0m ---- ---- 16MB 0B 27kB OK
2015-06-25 01:04:24 0m ---- 16kB 33MB 3842B 58kB OK
2015-06-25 00:59:10 0m 411MB ---- 251MB ---- 33MB OK
2015-06-24 23:18:39 14m 2059MB ---- 167MB ---- 163MB OK
2015-06-24 05:29:11 ---- ---- ---- ---- ---- 0B ERROR
2015-06-24 04:01:40 0m ---- 411MB 117MB ---- 30MB OK
2015-06-24 03:52:59 1m 411MB ---- 83MB ---- 32MB OK
2015-06-24 02:56:44 0m ---- 16kB 33MB 189kB 245kB OK
2015-06-24 02:51:55 0m 411MB ---- 33MB ---- 32MB OK
-bash-4.1$ pg_rman restore --recovery-target-timp "2015-06-25 02:41:00";
pg_rman: unrecognized option '--recovery-target-timp'
Try "pg_rman --help" for more information.
-bash-4.1$ pg_rman restore --recovery-target-time "2015-06-25 02:41:00";
ERROR: PostgreSQL server is running
-bash-4.1$ pg_ctl stop
waiting for server to shut down.... done
server stopped
-bash-4.1$ pg_rman restore --recovery-target-time "2015-06-25 02:41:00";
INFO: validate: 2015-06-25 02:37:36 backup and archive log files by SIZE
INFO: restore complete. Recovery starts automatically when the PostgreSQL server is started.
-bash-4.1$ psql
psql: 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"?
-bash-4.1$ pg_ctl start
server starting
-bash-4.1$ < 2015-06-25 02:47:02.421 EDT >LOG: redirecting log output to logging collector process
< 2015-06-25 02:47:02.421 EDT >HINT: Future log output will appear in directory "pg_log".
-bash-4.1$ psql
psql (9.4.3)
Type "help" for help.
postgres=# \q
-bash-4.1$
-bash-4.1$ cat postgresql-Thu.log
< 2015-06-25 02:47:02.422 EDT >LOG: database system was interrupted; last known up at 2015-06-25 02:37:36 EDT
< 2015-06-25 02:47:02.538 EDT >LOG: restored log file "00000004.history" from archive
< 2015-06-25 02:47:02.538 EDT >LOG: starting point-in-time recovery to 2015-06-25 02:41:00-04
< 2015-06-25 02:47:02.540 EDT >LOG: restored log file "00000004.history" from archive
< 2015-06-25 02:47:02.559 EDT >LOG: restored log file "000000040000000000000056" from archive
< 2015-06-25 02:47:02.588 EDT >LOG: redo starts at 0/56000090
< 2015-06-25 02:47:02.590 EDT >LOG: consistent recovery state reached at 0/560000B8
< 2015-06-25 02:47:02.608 EDT >LOG: restored log file "000000040000000000000057" from archive
< 2015-06-25 02:47:02.627 EDT >LOG: restored log file "000000040000000000000058" from archive
< 2015-06-25 02:47:02.647 EDT >LOG: restored log file "000000040000000000000059" from archive
< 2015-06-25 02:47:02.649 EDT >LOG: recovery stopping before commit of transaction 1970, time 2015-06-25 02:41:17.879472-04
< 2015-06-25 02:47:02.649 EDT >LOG: redo done at 0/59000028
< 2015-06-25 02:47:02.649 EDT >LOG: last completed transaction was at log time 2015-06-25 02:38:21.709358-04
< 2015-06-25 02:47:02.669 EDT >LOG: restored log file "000000040000000000000058" from archive
cp: cannot stat `/arclog/00000005.history': No such file or directory
< 2015-06-25 02:47:02.674 EDT >LOG: selected new timeline ID: 5
< 2015-06-25 02:47:02.676 EDT >LOG: restored log file "00000004.history" from archive
< 2015-06-25 02:47:02.754 EDT >LOG: archive recovery complete
< 2015-06-25 02:47:02.972 EDT >LOG: database system is ready to accept connections
< 2015-06-25 02:47:02.973 EDT >LOG: autovacuum launcher started
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29898569/viewspace-1711941/
,如需转载,请注明出处,否则将追究法律责任。