访问表报错:ERROR: could not access status of transaction 3067013767 Detail: Could not open file"sys clog/02DB": No such file or directory.
一、首先对数据库进行全库物理备份;
二、用dd进行伪造这个数据块(数据块伪造全部提交),并且更改权限
for i in {1..262144}; do printf '\125'; done > 0251
chown postgres:postgres 0251
chmod 600 0251
mv -i 0251 $PGDATA/pg_clog/0251
至于怎么丢失的那要你们自己找原因了。
Generate a 256K file of all "55" characters, which indicates all
transactions it might be looking for are treated as already commited:
for i in {1..262144}; do printf '\125'; done > committed
ls -l committed
od -xv committed | head
od -xv committed | tail
$ ls -l committed
-rw-r--r-- 1 gsmith gsmith 262144 2009-06-25 11:01 committed
$ od -xv committed | head
0000000 5555 5555 5555 5555 5555 5555 5555 5555
0000020 5555 5555 5555 5555 5555 5555 5555 5555
0000040 5555 5555 5555 5555 5555 5555 5555 5555
0000060 5555 5555 5555 5555 5555 5555 5555 5555
0000100 5555 5555 5555 5555 5555 5555 5555 5555
0000120 5555 5555 5555 5555 5555 5555 5555 5555
0000140 5555 5555 5555 5555 5555 5555 5555 5555
0000160 5555 5555 5555 5555 5555 5555 5555 5555
0000200 5555 5555 5555 5555 5555 5555 5555 5555
0000220 5555 5555 5555 5555 5555 5555 5555 5555
$ od -xv committed | tail
0777560 5555 5555 5555 5555 5555 5555 5555 5555
0777600 5555 5555 5555 5555 5555 5555 5555 5555
0777620 5555 5555 5555 5555 5555 5555 5555 5555
0777640 5555 5555 5555 5555 5555 5555 5555 5555
0777660 5555 5555 5555 5555 5555 5555 5555 5555
0777700 5555 5555 5555 5555 5555 5555 5555 5555
0777720 5555 5555 5555 5555 5555 5555 5555 5555
0777740 5555 5555 5555 5555 5555 5555 5555 5555
0777760 5555 5555 5555 5555 5555 5555 5555 5555
1000000
chown postgres.postgres committed
chmod 600 committed
mv -i committed $PGDATA/pg_clog/0646




