[心缘地方]同学录
首页 | 功能说明 | 站长通知 | 最近更新 | 编码查看转换 | 代码下载 | 常见问题及讨论 | 《深入解析ASP核心技术》 | 王小鸭自动发工资条VBA版
登录系统:用户名: 密码: 如果要讨论问题,请先注册。

[备忘]postgresql启动报错could not read block 0 in file "base/16384/671017": read only 0 of 8192 bytes

上一篇:[备忘]bat文件用管理员运行时闪退。
下一篇:[备忘]jdk7,并发调用https时,X509Factory.getFromCache很多BLOCKED

添加日期:2023/3/16 10:18:12 快速返回   返回列表 阅读222次
启动报错:
FATAL:  could not read block 0 in
 file "base/16384/671017": read only 0 of 8192 bytes

数据库无法启动修复方法:
(1)重建系统索引
reindexdb -h 127.0.0.1 -U postgres -p 5432 --system dbname
(2)zero_damaged_pages=on加入到postgre配置文件中。
(3)设置 ignore_system_indexes=true , 以尝试忽略system index的影响
启动pg,pg_ctl -D "/aaa/bb/data" -o "-c ignore_system_indexes=true" start
连接数据库psql $dbname
(3)重建全库索引
reindex database "dbname";
(4)vacuum 全表库
vacuum full analyze verbose;
vacuum full verbose;

下面两步不知道干啥用的,抄来的。
(5)禁用约束
update pg_class set relchecks=0 where relname='tablename';
(6)重建索引
reindex database "dbname";
(7)最后建议用pg_dump 导出全库后,重建数据库。
(8)如果做了上述步骤还不行,可以考虑用pg_filedump 抽取所有文件内的数据后再重建数据库。
 

评论 COMMENTS
没有评论 No Comments.

添加评论 Add new comment.
昵称 Name:
评论内容 Comment:
验证码(不区分大小写)
Validation Code:
(not case sensitive)
看不清?点这里换一张!(Change it here!)
 
评论由管理员查看后才能显示。the comment will be showed after it is checked by admin.
CopyRight © 心缘地方 2005-2999. All Rights Reserved