本文介绍了修复损坏的数据库PostgreSQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的postgresql数据库出现多个错误,这是在电涌后导致的:

I have multiple errors with my postgresql db, which resulted after a power surge:

我无法从数据库访问大多数表。例如,当我尝试从ac_cash_collection中选择 select * 时,我得到了愚蠢的错误:

I cannot access most tables from my database. When I try for example select * from ac_cash_collection, I get the foolowing error:

ERROR: missing chunk number 0 for toast value 118486855 in pg_toast_2619

我遇到以下错误:


Error message from server: ERROR:  relation "public.st_stock_item_newlist" does not exist
pg_dump: The command was: LOCK TABLE public.st_stock_item_newlist IN ACCESS SHARE MODE

我继续尝试对整个数据库进行重新索引,实际上我离开了它,进入睡眠状态,发现它在数据库中没有做任何事情。早上,所以我不得不取消它。

I went ahead and tried to run reindex of the whole database, I actually I left it runnng, went to sleep, and I found it had not done anything in the morning, so I had to cancel it.

我需要一些帮助来尽快解决此问题,请帮助。

I need some help to fix this as soon as possible, Please help.

推荐答案

在进行其他操作之前,请 并按照说明行事。否则可能会使问题变得更糟。

Before you do anything else, http://wiki.postgresql.org/wiki/Corruption and act on the instructions. Failure to do so risks making the problem worse.

,可能会使用: ignore_system_indexes zero_damaged_pa​​ges 。我从未使用过它们,但是如果我绝望的话,我会...

There are two configuration parameters listed in the Fine Manual that might be of use: ignore_system_indexes and zero_damaged_pages. I have never used them, but I would if I were desparate ...

我不知道它们是否对烤面包机有所帮助。无论如何,如果设置它们会导致您的数据库再次可用,我将{backup + drop + restore}使所有表和目录再次恢复为新生状态。成功!

I don't know if they help against toast-tables. In any case, if setting them causes your database(s) to become usable again, I would {backup + drop + restore} to get all tables and catalogs into newborn shape again. Success!

这篇关于修复损坏的数据库PostgreSQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 13:43