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 revision
Previous revision
Last revisionBoth sides next revision
how_to:repairing_corrupted_database [2020/03/16 15:07] paulhow_to:repairing_corrupted_database [2023/09/08 13:52] – [Finding the problem message] 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 37: Line 37:
  
 If 'kind' 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). If 'kind' 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).
 +
 +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 84: Line 86:
  
 This will read all the messages from the database, and tell you which message(s) it encountered an error with This will read all the messages from the database, and tell you which message(s) it encountered an error with
 +
 +However, sometimes it won't find all problem messages, so it is a good idea to run it again after fixing any problems, until this script doesn't find any more errors. 
  
 ===Getting message summary info=== ===Getting message summary info===
Line 90: Line 94:
   SELECT subject, messagetime, fromaddr, tolist FROM messages.msgdata WHERE msgdataid = <problem message id>;   SELECT subject, messagetime, fromaddr, tolist FROM messages.msgdata WHERE msgdataid = <problem message id>;
 and and
-  SELECT username, folder FROM messages.foldermessages INNER JOIN messages.folders USING(folderid) INNER JOIN users.users ON messages.folders.userid=users.users.usernumber WHERE <problem message id>;+  SELECT username, folder FROM messages.foldermessages INNER JOIN messages.folders USING(folderid) INNER JOIN users.users ON messages.folders.userid=users.users.usernumber WHERE msgdataid = <problem message id>;
  
 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
how_to/repairing_corrupted_database.txt · Last modified: 2024/01/15 11:35 by paul