User Tools

Site Tools


how_to:repairing_corrupted_database

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
how_to:repairing_corrupted_database [2016/02/05 11:24] – [Delete the problem message] paulhow_to:repairing_corrupted_database [2016/04/06 12:15] 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/index=====
 +Often the error message will say something like:
 +
 +  Invalid page header in block x in relation base/16385/512312
 +  
 +These numbers are 'random' so will be different from one installation to another. To determine which database table/index the relation refers to, follow these instructions
 +
 +Go to a command prompt in the VPOP3 directory and run 'psql' (in version 5 only). The default password is 'vpop3pass'
 +
 +Then type (or copy/paste)
 +
 +  select n.nspname AS schema, c.relname AS tablename, c.reltype as type from pg_class c inner join pg_namespace n on (c.relnamespace=n.oid) where c.relfilenode=<filename>;
 +  
 +In the above example error message <filename> would be replaced by 512312
 +
 +If 'type' is 'i' then the damaged relation is an index, so a database reindex should fix the problem. If it is 'r' then it is a normal table, or if it is 't' then it is a 'toast' table (see below).
  
 =====unexpected chunk number===== =====unexpected chunk number=====
how_to/repairing_corrupted_database.txt · Last modified: 2024/01/15 11:35 by paul