我有以下情况。
现在,我正在尝试执行以下操作: - 关闭postgres服务器。 - 使用PGDATA(/var/lib/postgresql/9.3/main)目录中的recovery.conf文件并在其中输入以下内容:
restore_command = 'cp /var/lib/postgresql/9.3/main/pg_xlog_backup_jan072016/%f %p'
recovery_target_time = '2016-01-07 03:00:00'
- 再次启动postgres服务器。
我在日志文件中看到的是:
postgres:~/9.3/main/pg_log$ tail -100f postgresql-2016-01-07_170256.log
2016-01-07 17:02:56 UTC LOG: database system was shut down at 2016-01-07 17:02:55 UTC
2016-01-07 17:02:56 UTC LOG: starting point-in-time recovery to 2016-01-06 00:00:00+00
cp: cannot stat ‘/var/lib/postgresql/9.3/main/pg_xlog_backup_jan072016/0000000A.history’: No such file or directory
cp: cannot stat ‘/var/lib/postgresql/9.3/main/pg_xlog_backup_jan072016/0000000A00000000000000CC’: No such file or directory
2016-01-07 17:02:56 UTC LOG: consistent recovery state reached at 0/CC000090
2016-01-07 17:02:56 UTC LOG: record with zero length at 0/CC000090
2016-01-07 17:02:56 UTC LOG: redo is not required
2016-01-07 17:02:56 UTC LOG: database system is ready to accept read only connections
cp: cannot stat ‘/var/lib/postgresql/9.3/main/pg_xlog_backup_jan072016/0000000A00000000000000CC’: No such file or directory
cp: cannot stat ‘/var/lib/postgresql/9.3/main/pg_xlog_backup_jan072016/0000000B.history’: No such file or directory
2016-01-07 17:02:56 UTC LOG: selected new timeline ID: 11
cp: cannot stat ‘/var/lib/postgresql/9.3/main/pg_xlog_backup_jan072016/0000000A.history’: No such file or directory
2016-01-07 17:02:57 UTC LOG: archive recovery complete
2016-01-07 17:02:57 UTC LOG: autovacuum launcher started
2016-01-07 17:02:57 UTC LOG: database system is ready to accept connections
2016-01-07 17:02:57 UTC LOG: incomplete startup packet
我的pg_xlog_backup_jan072016文件夹包含foll内容。:
:~/9.3/main/pg_xlog_backup_jan072016$ ls -larth
total 161M
-rw------- 1 postgres postgres 257 Jan 7 15:57 00000007.history
-rw------- 1 postgres postgres 16M Jan 7 15:57 0000000700000000000000CA
-rw------- 1 postgres postgres 16M Jan 7 15:57 0000000700000000000000C9
-rw------- 1 postgres postgres 16M Jan 7 15:57 0000000700000000000000C8
-rw------- 1 postgres postgres 16M Jan 7 15:57 0000000700000000000000C7
-rw------- 1 postgres postgres 16M Jan 7 15:57 0000000700000000000000C6
-rw------- 1 postgres postgres 16M Jan 7 15:57 0000000700000000000000C5
-rw------- 1 postgres postgres 16M Jan 7 15:57 0000000700000000000000C4
-rw------- 1 postgres postgres 16M Jan 7 15:57 0000000700000000000000C3
-rw------- 1 postgres postgres 16M Jan 7 15:57 0000000700000000000000C2
-rw------- 1 postgres postgres 16M Jan 7 15:57 0000000700000000000000C1
-rw------- 1 postgres postgres 298 Jan 7 15:57 00000007000000000000005D.00000028.backup
-rw------- 1 postgres postgres 214 Jan 7 15:57 00000006.history
-rw------- 1 postgres postgres 171 Jan 7 15:57 00000005.history
drwx------ 3 postgres postgres 4.0K Jan 7 16:54 .
drwx------ 18 postgres postgres 4.0K Jan 7 17:02 ..
drwx------ 2 postgres postgres 4.0K Jan 7 17:08 archive_status
我想弄清楚的是:
任何人都可以帮助我们吗? 谢谢。 Sarthak