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:24] – [Delete the problem message] paul | how_to:repairing_corrupted_database [2022/08/01 18:30] – [Repairing corrupted database] paul | ||
---|---|---|---|
Line 9: | Line 9: | ||
If that is not possible, then in some cases, you may be able to remove the damaged parts of the database and recover from there while keeping most of the important data intact. This article explains some possible ways to do this. Note that none of these methods are guaranteed, and are done at your own risk. | If that is not possible, then in some cases, you may be able to remove the damaged parts of the database and recover from there while keeping most of the important data intact. This article explains some possible ways to do this. Note that none of these methods are guaranteed, and are done at your own risk. | ||
- | We can help you with these under our chargeable service which costs £30/hr (or part of) for this type of problem, but there are no guarantees we will be able to recover anything. | + | We can help you with these under our chargeable service which costs £40/hr (or part of) for this type of problem, but there are no guarantees we will be able to recover anything. |
Before you start you should: | Before you start you should: | ||
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 ' | ||
+ | |||
+ | If the problem is in a normal table, then depending on the table name, you may be able to delete the table without losing critical data. Please contact support@pscs.co.uk with the table name and we will be able to tell you what is stored in that table, and how to delete it if that is an appropriate action. | ||
=====unexpected chunk number===== | =====unexpected chunk number===== | ||
Line 33: | Line 52: | ||
Unfortunately, | Unfortunately, | ||
- | Go to a command prompt in the VPOP3 directory and run ' | + | Go to a command prompt in the VPOP3\pgsql\bin |
====Finding the problem message==== | ====Finding the problem message==== | ||
Line 73: | Line 92: | ||
SELECT subject, messagetime, | SELECT subject, messagetime, | ||
and | and | ||
- | SELECT username, folder FROM messages.foldermessages INNER JOIN users.users ON messages.foldermessages.userid=users.users.username | + | SELECT username, folder FROM messages.foldermessages |
this will tell you summary information about the message which may help know which message will been deleted | this will tell you summary information about the message which may help know which message will been deleted | ||
Line 93: | Line 112: | ||
ALTER TABLE messages.foldermessages ENABLE TRIGGER USER; | ALTER TABLE messages.foldermessages ENABLE TRIGGER USER; | ||
+ | | ||
+ | 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: | In rare cases the database files may be even more corrupted, so you need to run this command before deleting the records: |