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:20:34 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=2&rev2=3

- = Derby Database Corruption Debugging =
+ = Derby Database Corruption Issues =
  
  Derby is a very stable database.
  
@@ -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: 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: 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; 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.
+ 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 ===
  
@@ -83, +83 @@

  
  === 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-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.
  
  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
  
- Note also, that if you've built the tools using trunk, and the database was created with
an older Derby version, you need the special alpha-version upgrade flag, e.g.: java -Dderby.database.allowPreReleaseUpgrade=true
org.apache.derby.tools.ij dataFileVTI-1.sql
+ Note also, that if you've built the tools using trunk, and the database was created with
an older Derby version, you need the special alpha-version upgrade flag, e.g.: java -Dderby.database.allowPreReleaseUpgrade=true
org.apache.derby.tools.ij !dataFileVTI-1.sql
  
  Which for instance for the syschemas showed this:
  
@@ -145, +145 @@

  This is from https://issues.apache.org/jira/browse/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. 
+ 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. 
  
  Usage:
  
- java TableSignatureReader connectionURL schemaName tableName
+ java !TableSignatureReader connectionURL schemaName tableName
  
  where
  
@@ -168, +168 @@

  
  Usage:
  
- java DataFileReader $dataFileName [ -v ] [ -d $D ] [ -p $P ] [ -n $N ] [ -e $encryptionAttributes
$serviceProperties ]
+ java !DataFileReader $dataFileName [ -v ] [ -d $D ] [ -p $P ] [ -n $N ] [ -e $encryptionAttributes
$serviceProperties ]
  
  -v Verbose. Print out records and slot tables. Field data appears as byte arrays. If you
do not set this flag, the tool just decodes the page headers.
  -d Data signature. This makes a verbose printout turn the field data into objects. $D is
a row signature, e.g., "( a int, b varchar( 30 ) )"
@@ -178, +178 @@

  
  For example, the following command deserializes all of the records in the SYSCONGLOMERATES
file:
  
- java DataFileReader db/seg0/c20.dat -v -d "( a char(36), b char(36), c bigint, d varchar(
128), e boolean, f serializable, g boolean, h char( 36 ) )"
+ java !DataFileReader db/seg0/c20.dat -v -d "( a char(36), b char(36), c bigint, d varchar(
128), e boolean, f serializable, g boolean, h char( 36 ) )"
  
  The following command decodes the entire SYSCOLUMNS conglomerate:
  
- java DataFileReader db/seg0/c90.dat -v -d "( a char(36), b char(128), c int, d serializable,
e serializable, f char( 36 ), g bigint, h bigint, i bigint )"
+ java !DataFileReader db/seg0/c90.dat -v -d "( a char(36), b char(128), c int, d serializable,
e serializable, f char( 36 ), g bigint, h bigint, i bigint )"
  
  Note the special 'serializable' type in the preceding example. Use 'serializable' for user-defined
types and for the system columns which are objects.
  
  The following example decrypts and deserializes an entire SYSCONGLOMERATES file, dumping
the result into an xml file for inspection:
  
- java DataFileReader wombat/seg0/c20.dat -v -d "( a char(36), b char(36), c bigint, d varchar(
128), e boolean, f serializable, g boolean, h char( 36 ) )" -e Wednesday wombat/service.properties
> z.xml
+ java !DataFileReader wombat/seg0/c20.dat -v -d "( a char(36), b char(36), c bigint, d varchar(
128), e boolean, f serializable, g boolean, h char( 36 ) )" -e Wednesday wombat/service.properties
> z.xml
  
  Note the special 'serializable' type in the preceding example. Use 'serializable' for user-defined
types and for the system columns which are objects.
  
  Here are examples of using this tool on encrypted databases:
  
- java DataFileReader encryptedDB/seg0/c490.dat -v -d "( a varchar( 50 ), b char( 11 ) )"
-e "encryptionKey=abcd1234efab5678" encryptedDB/service.properties > ~/junk/z.xml
+ java !DataFileReader encryptedDB/seg0/c490.dat -v -d "( a varchar( 50 ), b char( 11 ) )"
-e "encryptionKey=abcd1234efab5678" encryptedDB/service.properties > ~/junk/z.xml
  
- java DataFileReader bootpasswordDB/seg0/c490.dat -v -d "( a varchar( 50 ), b char( 11 )
)" -e "bootPassword=mysecretpassword" bootpasswordDB/service.properties > ~/junk/zz.xml
+ java !DataFileReader bootpasswordDB/seg0/c490.dat -v -d "( a varchar( 50 ), b char( 11 )
)" -e "bootPassword=mysecretpassword" bootpasswordDB/service.properties > ~/junk/zz.xml
  
  Other examples of usage:
  
@@ -204, +204 @@

  
  1) Decode an entire data file, putting the resulting xml in the file z.xml. You can then
view that file using a browser like Firefox, which lets you collapse and expand the elements.
  
- java DataFileReader db/seg0/c20.dat -v -d "( a char(36), b char(36), c bigint, d varchar(
128), e boolean, f serializable, g boolean, h char( 36 ) )" > z.xml
+ java !DataFileReader db/seg0/c20.dat -v -d "( a char(36), b char(36), c bigint, d varchar(
128), e boolean, f serializable, g boolean, h char( 36 ) )" > z.xml
  
  -------------------------------------------
  
  2) Pretty-print the file header:
  
- java DataFileReader db/seg0/c20.dat -n 1
+ java !DataFileReader db/seg0/c20.dat -n 1
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <dataFile>
  <fileHeader>
@@ -275, +275 @@

  
  3) Count the number of pages in a data file:
  
- java DataFileReader db/seg0/c20.dat | grep pageCount <pageCount>9</pageCount>
+ java !DataFileReader db/seg0/c20.dat | grep pageCount <pageCount>9</pageCount>
  
  -------------------------------------------
  
  4) Decode 3 pages, starting at page 2. This one is a little tricky because the header page
is always decoded. So you need to ask for 4 pages (3 data pages plus 1 header page):
  
- java DataFileReader db/seg0/c20.dat -v -p 4 -n 3
+ java !DataFileReader db/seg0/c20.dat -v -p 4 -n 3
  
  === LogFileReader and ControlFileReader ===
  
@@ -290, +290 @@

  
  Usage:
  
- java LogFileReader $logFileName [ -v ] [ -p $P ] [ -n $N ] [ -e $bootPassword $serviceProperties
]
+ java !LogFileReader $logFileName [ -v ] [ -p $P ] [ -n $N ] [ -e $bootPassword $serviceProperties
]
  
  -v Verbose. Deserialize the logged operations. If you do not set this flag, the tool just
decodes the wrapper headers.
  -p Starting position. $P is a positive number, the offset of the first log entry to read.
This causes the tool to skip reading the file header as well.
@@ -299, +299 @@

  
  The following example decrypts and deserializes an entire log file, dumping the result into
an xml file for inspection:
  
- java LogFileReader wombat/log/log1.dat -v -e Wednesday wombat/service.properties > z.xml
+ java !LogFileReader wombat/log/log1.dat -v -e Wednesday wombat/service.properties > z.xml
  
  ------------------------------------------------------------
  
@@ -307, +307 @@

  
  1) Decode an entire log file, putting the resulting xml in the file z.xml. You can then
view that file using a browser like Firefox, which lets you collapse and expand the elements.
Because the -v switch is specified, the contents of the logged operations are deserialized
and <details> elements are populated with the toString() results:
  
- java LogFileReader db/log/log2.dat -v > z.xml
+ java !LogFileReader db/log/log2.dat -v > z.xml
  
  ------------------------------------------------------------
  
  2) Pretty-print a log file header:
  
- java LogFileReader db/log/log2.dat -n 0
+ java !LogFileReader db/log/log2.dat -n 0
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <logFile>
  <formatableID>128</formatableID>
@@ -332, +332 @@

  
  3) Count the number of entries in a log file:
  
- java LogFileReader db/log/log2.dat | grep recordCount
+ java !LogFileReader db/log/log2.dat | grep recordCount
  <recordCount>156</recordCount>
  
  ------------------------------------------------------------
  
  4) Decode 3 log entries, starting at a given record offset:
  
- java LogFileReader db/log/log2.dat -v -p 29363 -n 3
+ java !LogFileReader db/log/log2.dat -v -p 29363 -n 3
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <logFile>
  <logRecords>
@@ -412, +412 @@

  
  Usage:
  
- java ControlFileReader db/log/log.ctrl
+ java !ControlFileReader db/log/log.ctrl
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <controlFile>
  <formatableID>128</formatableID>
@@ -433, +433 @@

  
    Another example:
  
- java ControlFileReader generated/toursdb/toursdb/log/log.ctrl
+ java !ControlFileReader generated/toursdb/toursdb/log/log.ctrl
  <?xml version="1.0" encoding="UTF-8"?><controlFile>
      <formatableID>128</formatableID>
      <obsoleteVersion>9</obsoleteVersion>

Mime
View raw message