db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-derby Wiki] Update of "DatabaseCorruption" by MyrnavanLunteren
Date Wed, 18 Dec 2013 23:01:43 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.

The "DatabaseCorruption" page has been changed by MyrnavanLunteren:
https://wiki.apache.org/db-derby/DatabaseCorruption?action=diff&rev1=1&rev2=2

- = Derby Database Corruption =
+ = Derby Database Corruption Debugging =
  
  Derby is a very stable database.
  
@@ -8, +8 @@

  
  This document explores some of the issues related to database corruption, including things
that might cause corruption, and techniques for dealing with a corrupted database.
  
- == Categories of Corruption ==
+ = Categories of Corruption =
  
  There are two types of corruption
  
@@ -22, +22 @@

       *  In this case, sometimes some remedial activity can be attempted, such as dropping
and recreating indexes if the problem is with one of the index files, or (off line) compress.
The first step is to do a Consistency Check. More about this below.
  
  
- == Possible Causes of Database Corruption ==
+ = Possible Causes of Database Corruption =
  
  The Derby Developers community is always attempting to ensure database corruption is as
unlikely as is possible. However, there are some issues that have shown in the past to lead
to database corruption:
  
@@ -40, +40 @@

     * Bugs. In rare occasions, bugs in Derby have been responsible for database corruption.
The Derby Development community is always fixing these, so checking JIRA for these is important.
  
  
- == Prevention/Preparedness ==
+ = Prevention/Preparedness =
  
  Matching the list of possible causes above, one can do the following to prepare and prevent
database corruption:
  
@@ -52, +52 @@

     * Ensure you have a backup plan / scenario. (See the manuals for tips, and this web site:
http://www.ibm.com/developerworks/data/library/techarticle/dm-0502thalamati/)
  
  
- == Salvage ==
+ = Salvage =
  
  If the database has become corrupt, and you do not have a usable backup, there are still
a couple of approaches for salvaging as much as possible from the damaged databases. This
is not a guaranteed mechanism of restoring a database - depending on the corruption, the tools
may not be able to access the database, and even if they do, in the end, there may still be
data missing, and it's impossible to say what. Having a proper backup plan, and restoring
from backup is still a better option.
  
@@ -62, +62 @@

     * Run off-line compress. This will also rebuild the indexes.
     * Use the optional tools. See below.
  
- === Optional Tools for working with corrupt databases ===
+ == Optional Tools for working with corrupt databases ==
  
  There are some optional tools that have been written to facilitate crawling a database in
the face of corruption. These are not part of the product distributions, and at time of writing
this (December 2013), they are not even checked-in into the source code. To use them (currently),
you will have to download the various tools from their JIRAs and compile with access to the
derby.jars. These tools are (partly) based on some documentation on the Apache Derby web site:
  
@@ -77, +77 @@

  
  Note: currently, to compile LogFileReader.java in trunk, you need to adjust the permissions
of the method org.apache.derby.iapi.services.io.RegisteredFormatIds.TwoByte from private to
public.
  
- ==== ListOfTables ====
+ === ListOfTables ===
  
  First it is helpful to understand the connection between tablenames and the .dat filenames.
See this page: http://wiki.apache.org/db-derby/ListFileNamesOfTables. A quick way to go from
container/conglomerate number is to convert the container number from dec to hex. Then add
'c' to the front and '.dat' as extension. If the hex number ends in 0 it is a base table,
and if it ends in 1, it is a btree (index).
  
- ==== RawDBReader====
+ === RawDBReader ===
  
  The first of these tools is DataFileVTI and RawDBReader.java of https://issues.apache.org/jira/browse/DERBY-6136DERBY-6136.
The JIRA issue provided a .sql file which can be used to access a database. You have to change
the path in the .sql.
  
@@ -140, +140 @@

  
  See https://issues.apache.org/jira/browse/DERBY-6136: for more examples when the database
is encrypted, or using other authentication mechanisms.
  
- ==== TableSignatureReader.java and DataFileReader.java ====
+ === TableSignatureReader.java and DataFileReader.java ===
  
  This is from https://issues.apache.org/jira/browse/DERBY-5201. The intention is to read
the seg0.
- ===== TableSignatureReader =====
+ ==== TableSignatureReader ====
  
  This tool prints out the signature of a table, which is needed for the DataFileReader. This
 tool did not work with just compiled classes for me, it gave a 'java.sql.Exception: No suitable
driver". But it worked with jars (derbyrun.jar) in the classpath. 
  
@@ -164, +164 @@

  ...which prints out the following result:
  
  ( "ALIASID" char( 36 ), "ALIAS" varchar( 128 ), "SCHEMAID" char( 36 ), "JAVACLASSNAME" long
varchar, "ALIASTYPE" char( 1 ), "NAMESPACE" char( 1 ), "SYSTEMALIAS" boolean, "ALIASINFO"
serializable, "SPECIFICNAME" varchar( 128 ) )
- DataFileReader
+ ==== DataFileReader ====
  
  Usage:
  
@@ -283, +283 @@

  
  java DataFileReader db/seg0/c20.dat -v -p 4 -n 3
  
- ==== LogFileReader and ControlFileReader ====
+ === LogFileReader and ControlFileReader ===
  
  These are from https://issues.apache.org/jira/browse/DERBY-5195; Create tools for browsing
the files in the database log directory.
- ===== LogFileReader =====
+ ==== LogFileReader ====
  
  Usage:
  

Mime
View raw message