PostgreSQL错误PANIC:找不到有效的检查点记录 [英] postgresql error PANIC: could not locate a valid checkpoint record

查看:1016
本文介绍了PostgreSQL错误PANIC:找不到有效的检查点记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我加载postgres服务器(v9.0.1)时,我感到恐慌,无法启动它:

When I load up the postgres server (v9.0.1) i get a panic that prevents it from starting:


PANIC:可以找不到有效的检查点记录

PANIC: could not locate a valid checkpoint record

我该如何解决?

推荐答案

它正在事务日志中寻找可能不存在或已损坏的检查点记录。您可以通过运行以下命令确定是否存在这种情况:

It's looking for a checkpoint record in the transaction log that probably doesn't exist or is corrupted. You can determine if this is the case by running:

# Postgres < 10.0
pg_resetxlog DATADIR

# Postgres >= 10.0
pg_resetwal DATADIR

如果事务日志已损坏,您将看到以下消息:

If the transaction log is corrupt, you'll see a message like:


数据库服务器未关闭干净地重置
事务日志可能会导致数据丢失。如果仍要继续
,请使用-f强制重置。

The database server was not shut down cleanly. Resetting the transaction log might cause data to be lost. If you want to proceed anyway, use -f to force reset.

然后可以按照说明进行操作 -f 强制更新:

You can then follow the instructions and run with -f to force the update:

# Postgres < 10.0
pg_resetxlog -f DATADIR 

# Postgres >= 10.0
pg_resetwal -f DATADIR

这应该重置事务日志,但是,如
pg_resetxlog
上的PostgreSQL文档:

That should reset the transaction log, however it could leave your database in an indeterminate state as explained in the PostgreSQL documentation on pg_resetxlog:


如果pg_resetxlog抱怨无法确定pg_control的有效数据,则可以通过指定 -f 强制其继续进行(强制)开关。在这种情况下,将用合理的值代替丢失的数据。可以期望大多数字段都匹配,但是下一个OID,下一个事务ID和纪元,下一个多事务ID和偏移量以及WAL起始地址字段可能需要手动协助。可以使用下面讨论的开关设置这些字段。如果您不能为所有这些字段确定正确的值,则仍可以使用 -f ,但是对恢复的数据库的怀疑比平时要多:转储和重新加载势在必行。转储之前不要在数据库中执行任何数据修改操作,因为任何此类操作都可能使损坏更严重。

If pg_resetxlog complains that it cannot determine valid data for pg_control, you can force it to proceed anyway by specifying the -f (force) switch. In this case plausible values will be substituted for the missing data. Most of the fields can be expected to match, but manual assistance might be needed for the next OID, next transaction ID and epoch, next multitransaction ID and offset, and WAL starting address fields. These fields can be set using the switches discussed below. If you are not able to determine correct values for all these fields, -f can still be used, but the recovered database must be treated with even more suspicion than usual: an immediate dump and reload is imperative. Do not execute any data-modifying operations in the database before you dump, as any such action is likely to make the corruption worse.

这篇关于PostgreSQL错误PANIC:找不到有效的检查点记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆