加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgresql错误PANIC:找不到有效的检查点记录

发布时间:2020-12-13 16:40:18 所属栏目:百科 来源:网络整理
导读:当我加载postgres服务器(v9.0.1)我得到一个恐慌,阻止它开始: PANIC: could not locate a valid checkpoint record 如何解决这个问题? 它正在查找可能不存在或已损坏的事务日志中的检查点记录。您可以通过运行以确定是否是这种情况: pg_resetxlog DATADIR
当我加载postgres服务器(v9.0.1)我得到一个恐慌,阻止它开始:

PANIC: could not locate a valid checkpoint record

如何解决这个问题?

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

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

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强制更新:

pg_resetxlog -f DATADIR

这应该重置事务日志,但是它可能会使数据库处于不确定状态,如PostgreSQL documentation on
pg_resetxlog中所述:

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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读