This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
how_to:repairing_corrupted_database [2016/02/05 11:22] – [Delete the problem message] paul | how_to:repairing_corrupted_database [2016/04/06 12:16] – [Finding the problem table/index] paul | ||
---|---|---|---|
Line 20: | Line 20: | ||
Once you have repaired the database you should ideally perform a manual database backup & restore to ensure there are no other problems before restarting VPOP3. | Once you have repaired the database you should ideally perform a manual database backup & restore to ensure there are no other problems before restarting VPOP3. | ||
+ | |||
+ | =====Finding the problem table/ | ||
+ | Often the error message will say something like: | ||
+ | |||
+ | Invalid page header in block x in relation base/ | ||
+ | | ||
+ | These numbers are ' | ||
+ | |||
+ | Go to a command prompt in the VPOP3 directory and run ' | ||
+ | |||
+ | Then type (or copy/paste) | ||
+ | |||
+ | select n.nspname AS schema, c.relname AS tablename, c.relkind as kind from pg_class c inner join pg_namespace n on (c.relnamespace=n.oid) where c.relfilenode=< | ||
+ | | ||
+ | In the above example error message < | ||
+ | |||
+ | If ' | ||
=====unexpected chunk number===== | =====unexpected chunk number===== | ||
Line 94: | Line 111: | ||
ALTER TABLE messages.foldermessages ENABLE TRIGGER USER; | ALTER TABLE messages.foldermessages ENABLE TRIGGER USER; | ||
| | ||
- | In rare cases the database files may be even more corrupted, so you need to do: | + | Failure to re-enable the triggers will cause big problems for VPOP3! |
+ | |||
+ | In rare cases the database files may be even more corrupted, so you need to run this command before deleting the records: | ||
SET zero_damaged_pages=on; | SET zero_damaged_pages=on; | ||
| | ||
+ | This should be considered a 'last resort' | ||
====Rebuild database==== | ====Rebuild database==== | ||
After you have done this, we strongly recommend doing a full [[backup_vpop3# | After you have done this, we strongly recommend doing a full [[backup_vpop3# | ||
====Also See==== | ====Also See==== | ||
[[PostgreSQL Server won't start due to damaged log files]] | [[PostgreSQL Server won't start due to damaged log files]] |