You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by Apache Wiki <wi...@apache.org> on 2013/12/19 11:04:09 UTC

[Db-derby Wiki] Update of "DatabaseCorruption" by KnutAndersHatlen

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 KnutAndersHatlen:
https://wiki.apache.org/db-derby/DatabaseCorruption?action=diff&rev1=4&rev2=5

          ERROR XSDBB: Unknown page format at page Page(11093,Container(0, 1745))
          The only way to recover from such an error is to restore from a good backup or recreate the database and schema.
     * The database boots, but some other store error is returned.
-      *  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.
+      *  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 ([[http://db.apache.org/derby/docs/10.10/ref/rrefaltertablecompress.html|SYSCS_UTIL.SYSCS_COMPRESS_TABLE]]). The first step is to do a Consistency Check. More about this below.
  
  
  = Possible Causes of Database Corruption =
@@ -59, +59 @@

     * run the !ConsistencyChecker: DatabaseConsistencyCheck
       *   If the corruption is in an index (usually .dat files with names ending in '1' represent an index), drop it.
       *   select all data from accessible tables and move them into another database using ij.
-    * Run off-line compress. This will also rebuild the indexes.
+    * Run off-line compress ([[http://db.apache.org/derby/docs/10.10/ref/rrefaltertablecompress.html|SYSCS_UTIL.SYSCS_COMPRESS_TABLE]]). This will also rebuild the indexes.
     * Use the optional tools. See below.
  
  == Optional Tools for working with corrupt databases ==
@@ -71, +71 @@

  
  The optional tools are found in these JIRAs:
  
-    * https://issues.apache.org/jira/browse/DERBY-6136: create a custom/optional tool for dumping the data in a corrupted database; !dataFileVTI.sql, !DataFileVTI.java and !RawDBReader.java
+    * [[https://issues.apache.org/jira/browse/DERBY-6136|DERBY-6136]]: create a custom/optional tool for dumping the data in a corrupted database; dataFileVTI.sql, DataFileVTI.java and RawDBReader.java
-    * https://issues.apache.org/jira/browse/DERBY-5201: Create tools for reading the contents of the seg0 directory; !TableSignatureReader.java and !DataFileReader.java
+    * [[https://issues.apache.org/jira/browse/DERBY-5201|DERBY-5201]]: Create tools for reading the contents of the seg0 directory; !TableSignatureReader.java and !DataFileReader.java
-    * https://issues.apache.org/jira/browse/DERBY-5195; Create tools for browsing the files in the database log directory; !LogFileReader.java and !ControlFileReader.java
+    * [[https://issues.apache.org/jira/browse/DERBY-5195|DERBY-5195]]: Create tools for browsing the files in the database log directory; !LogFileReader.java and !ControlFileReader.java
  
  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 ===
  
- 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).
+ First it is helpful to understand the connection between tablenames and the .dat filenames. See this page: 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 ===
  
- 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.
+ The first of these tools is DataFileVTI and RawDBReader.java of [[https://issues.apache.org/jira/browse/DERBY-6136|DERBY-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.
  
  Note, that you *do* need to know the passwords of the various users to access their schemas. Otherwise, the tool will give an error like this: 
  {{{ The exception 'java.lang.Exception: APP is not the owner of the database }}}
@@ -138, +138 @@

  
  The schemas starting with 'RAW_' will be removed again when you unregister the tool.
  
- See https://issues.apache.org/jira/browse/DERBY-6136: for more examples when the database is encrypted, or using other authentication mechanisms.
+ See [[https://issues.apache.org/jira/browse/DERBY-6136|DERBY-6136]]: for more examples when the database is encrypted, or using other authentication mechanisms.
  
  === TableSignatureReader.java and DataFileReader.java ===
  
- This is from https://issues.apache.org/jira/browse/DERBY-5201. The intention is to read the seg0.
+ This is from [[https://issues.apache.org/jira/browse/DERBY-5201|DERBY-5201]]. The intention is to read the seg0.
  ==== 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. 
@@ -276, +276 @@

  
  === 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.
+ These are from [[https://issues.apache.org/jira/browse/DERBY-5195|DERBY-5195]]: Create tools for browsing the files in the database log directory.
  
  ==== LogFileReader ====