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 Thu, 19 Dec 2013 00:07:55 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=3&rev2=4

  
  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, 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:
  
-     { dataSrc: "unbound", dataSrcObj: { noAutoLoad: true }, render: "code", renderObj: {
style: "border: 1px solid #88c; border-radius: 6px; width: 80%; background-color: #ddf; white-space:
pre; font-family: courier;" }, obj: { body: "ij> select * from sysschemas;<br><br>SCHEMAID|SCHEMANAME|AUTHORIZATIONID<br>-------------------------------------------------------------------<br>c013800d-00f8-5b53-28a9-00000019ed88|SYSIBM|DBA<br>8000000d-00d0-fd77-3ed8-000a0a0b1900|SYS|DBA<br>c013800d-00fb-2641-07ec-000000134f30|SYSCAT|DBA<br>c013800d-00fb-2642-07ec-000000134f30|SYSFUN|DBA<br>c013800d-00fb-2643-07ec-000000134f30|SYSPROC|DBA<br>c013800d-00fb-2644-07ec-000000134f30|SYSSTAT|DBA<br>c013800d-00fb-2647-07ec-000000134f30|NULLID|DBA<br>c013800d-00fb-2648-07ec-000000134f30|SQLJ|DBA<br>c013800d-00fb-2646-07ec-000000134f30|SYSCS_DIAG|DBA<br>c013800d-00fb-2649-07ec-000000134f30|SYSCS_UTIL|DBA<br>80000000-00d2-b38f-4cda-000a0a412c00|APP|APP<br>2faf0139-011a-2edf-f872-00000306a538|TSTSCHEMA|DIDA"
}, id: "ii0" }
+ {{{
-     ij> select * from sysschemas;
+ ij> select * from sysschemas;
- 
      SCHEMAID|SCHEMANAME|AUTHORIZATIONID
      -------------------------------------------------------------------
      c013800d-00f8-5b53-28a9-00000019ed88|SYSIBM|DBA
@@ -108, +109 @@

      c013800d-00fb-2649-07ec-000000134f30|SYSCS_UTIL|DBA
      80000000-00d2-b38f-4cda-000a0a412c00|APP|APP
      2faf0139-011a-2edf-f872-00000306a538|TSTSCHEMA|DIDA 
+ }}}
  
  A second mechanism to access the database is by registering a custom tool. You need to have
a database physically upgraded to at least 10.10 or the syscs_register_tool procedure will
not be available:
  
- call syscs_util.syscs_register_tool('customTool',<register_or_un>,'<name of the
class>,'<controlschemaname>',<tableprefix>, '<database_location>','<bootpwd>','<dbo_username>','<dbo_password'>);
+ {{{ call syscs_util.syscs_register_tool('customTool',<register_or_un>,'<name of
the class>,'<controlschemaname>',<tableprefix>, '<database_location>','<bootpwd>','<dbo_username>','<dbo_password'>);
}}}
  
  For example:
  
- call syscs_util.syscs_register_tool('customTool',true,'RawDBReader','CONTROL','RAW_', 'c:/10tst/opttools/corruptdb/TST',null,'APP',null);
+ {{{ call syscs_util.syscs_register_tool('customTool',true,'RawDBReader','CONTROL','RAW_',
'c:/10tst/opttools/corruptdb/TST',null,'APP',null); }}}
  
  At this point, you can select contents from the corrupted database.  Tor instance, if there's
a table 'sched' in the schema 'TSTSCHEMA', like so:
- 
- select * from RAW_TSTSCHEMA.SCHED;
+ {{{ select * from RAW_TSTSCHEMA.SCHED; }}}
  
  I found, that a good way to effectively see all schemas and their tables was to run this
query in ij (after issuing maximumdisplaywidth 20;)
- 
+ {{{
  ij> SELECT SCHEMANAME, TABLENAME FROM sys.sysschemas s, sys.systables t WHERE s.schemaid
= t.schemaid
  
  SCHEMANAME          |TABLENAME
@@ -131, +132 @@

  TSTSCHEMA          |SCHED
  RAW_TSTSCHEMA      |SCHED
  ...
- 
+ }}}
  and you unregister the tool like so;
- 
- call syscs_util.syscs_register_tool ('customTool',false,'RawDBReader','CONTROL','RAW_');
+ {{{ call syscs_util.syscs_register_tool ('customTool',false,'RawDBReader','CONTROL','RAW_');
}}}
  
  The schemas starting with 'RAW_' will be removed again when you unregister the tool.
  
@@ -148, +148 @@

  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
- 
+ {{{
- connectionURL e.g. "jdbc:derby:db1"
+    connectionURL e.g. "jdbc:derby:db1"
- schemaName case-sensitive schema name, e.g. APP
+    schemaName case-sensitive schema name, e.g. APP
- tableName case-sensitive table name, e.g. T1
+    tableName case-sensitive table name, e.g. T1
- 
+ }}}
  Here's an example use...
- 
- java TableSignatureReader "jdbc:derby:db1" SYS SYSALIASES
+ {{{ java TableSignatureReader "jdbc:derby:db1" SYS SYSALIASES }}}
  
  ...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 ) )
+ ( "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 ====
  
  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 ] }}}
  
+ where
+ {{{
- -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.
+    -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 ) )"
+    -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 ) )"
- -p Starting page. $P is a number which must be at least 1, the first page to read after
the header. Page 0 (the header) is always read.
+    -p Starting page. $P is a number which must be at least 1, the first page to read after
the header. Page 0 (the header) is always read.
- -n Number of pages to read. $N is a positive number. Defaults to all subsequent pages.
+    -n Number of pages to read. $N is a positive number. Defaults to all subsequent pages.
- -e If the database is encrypted, you must supply the encryption attributes and the location
of service.properties.
+    -e If the database is encrypted, you must supply the encryption attributes and the location
of service.properties.
- 
+ }}}
  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:
  
- -------------------------------------------
- 
  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>
+   <fileHeader>
- <allocPage number="0">
+     <allocPage number="0">
- <formatableID>118</formatableID>
+       <formatableID>118</formatableID>
- <pageHeader>
+       <pageHeader>
- <isOverFlowPage>false</isOverFlowPage>
+         <isOverFlowPage>false</isOverFlowPage>
- <status hexvalue="1">
+         <status hexvalue="1">
- <flag>VALID_PAGE</flag>
+           <flag>VALID_PAGE</flag>
- </status>
+         </status>
- <pageVersion>9</pageVersion>
+         <pageVersion>9</pageVersion>
- <slotsInUse>0</slotsInUse>
+         <slotsInUse>0</slotsInUse>
- <nextRecordID>6</nextRecordID>
+         <nextRecordID>6</nextRecordID>
- <pageGeneration>0</pageGeneration>
+         <pageGeneration>0</pageGeneration>
- <previousGeneration>0</previousGeneration>
+         <previousGeneration>0</previousGeneration>
- <beforeImagePageLocation>0</beforeImagePageLocation>
+         <beforeImagePageLocation>0</beforeImagePageLocation>
- <deletedRowCount>1</deletedRowCount>
+         <deletedRowCount>1</deletedRowCount>
- </pageHeader>
+       </pageHeader>
- <nextAllocPageNumber>-1</nextAllocPageNumber>
+       <nextAllocPageNumber>-1</nextAllocPageNumber>
- <nextAllocPageOffset>0</nextAllocPageOffset>
+       <nextAllocPageOffset>0</nextAllocPageOffset>
- <containerInfoLength>80</containerInfoLength>
+       <containerInfoLength>80</containerInfoLength>
- <containerInfo>
+       <containerInfo>
- <formatableID>116</formatableID>
+         <formatableID>116</formatableID>
- <containerStatus hexvalue="0">
+         <containerStatus hexvalue="0">
- </containerStatus>
+         </containerStatus>
- <pageSize>4096</pageSize>
+         <pageSize>4096</pageSize>
- <spareSpace>0</spareSpace>
+         <spareSpace>0</spareSpace>
- <minimumRecordSize>12</minimumRecordSize>
+         <minimumRecordSize>12</minimumRecordSize>
- <initialPages>1</initialPages>
+         <initialPages>1</initialPages>
- <preAllocSize>8</preAllocSize>
+         <preAllocSize>8</preAllocSize>
- <firstAllocPageNumber>0</firstAllocPageNumber>
+         <firstAllocPageNumber>0</firstAllocPageNumber>
- <firstAllocPageOffset>0</firstAllocPageOffset>
+         <firstAllocPageOffset>0</firstAllocPageOffset>
- <containerVersion>0</containerVersion>
+         <containerVersion>0</containerVersion>
- <estimatedRowCount>71</estimatedRowCount>
+         <estimatedRowCount>71</estimatedRowCount>
- <reusableRecordIdSequenceNumber>0</reusableRecordIdSequenceNumber>
+         <reusableRecordIdSequenceNumber>0</reusableRecordIdSequenceNumber>
- <spare>0</spare>
+         <spare>0</spare>
- <checksum>2463908068</checksum>
+         <checksum>2463908068</checksum>
- </containerInfo>
+       </containerInfo>
- <allocationExtent>
+       <allocationExtent>
- <extentOffset>4096</extentOffset>
+         <extentOffset>4096</extentOffset>
- <extentStart>1</extentStart>
+         <extentStart>1</extentStart>
- <extentEnd>10216</extentEnd>
+         <extentEnd>10216</extentEnd>
- <extentLength>8</extentLength>
+         <extentLength>8</extentLength>
- <extentStatus hexvalue="30000010">
+         <extentStatus hexvalue="30000010">
- <flag>HAS_UNFILLED_PAGES</flag>
+           <flag>HAS_UNFILLED_PAGES</flag>
- <flag>KEEP_UNFILLED_PAGES</flag>
+           <flag>KEEP_UNFILLED_PAGES</flag>
- <flag>NO_DEALLOC_PAGE_MAP</flag>
+           <flag>NO_DEALLOC_PAGE_MAP</flag>
- </extentStatus>
+         </extentStatus>
- <preAllocLength>7</preAllocLength>
+         <preAllocLength>7</preAllocLength>
- <reserved1>0</reserved1>
+         <reserved1>0</reserved1>
- <reserved2>0</reserved2>
+         <reserved2>0</reserved2>
- <reserved3>0</reserved3>
+         <reserved3>0</reserved3>
- <freePages totalLength="8" bitsThatAreSet="0"/>
+         <freePages totalLength="8" bitsThatAreSet="0"/>
- <unFilledPages totalLength="8" bitsThatAreSet="1"/>
+         <unFilledPages totalLength="8" bitsThatAreSet="1"/>
- </allocationExtent>
+       </allocationExtent>
- </allocPage>
+     </allocPage>
- </fileHeader>
+   </fileHeader>
- <pageCount>1</pageCount>
+   <pageCount>1</pageCount>
- </dataFile>
+ </dataFile> 
+ }}}
- 
- -------------------------------------------
  
  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 ===
  
  These are from https://issues.apache.org/jira/browse/DERBY-5195; Create tools for browsing
the files in the database log directory.
+ 
  ==== LogFileReader ====
  
  Usage:
- 
- java !LogFileReader $logFileName [ -v ] [ -p $P ] [ -n $N ] [ -e $bootPassword $serviceProperties
]
+ {{{ java LogFileReader $logFileName [ -v ] [ -p $P ] [ -n $N ] [ -e $bootPassword $serviceProperties
] }}}
- 
+ where 
+ {{{
- -v Verbose. Deserialize the logged operations. If you do not set this flag, the tool just
decodes the wrapper headers.
+    -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.
+    -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.
- -n Number of records to read. $N is a non-negative number. If you do not specify this flag,
the tool prints all subsequent log entries.
+    -n Number of records to read. $N is a non-negative number. If you do not specify this
flag, the tool prints all subsequent log entries.
- -e If the database is encrypted, you must supply the boot password and the location of service.properties.
+    -e If the database is encrypted, you must supply the boot password and the location of
service.properties.
+ }}}
  
  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 }}}
- 
- ------------------------------------------------------------
  
  More examples:
  
  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>
+   <formatableID>128</formatableID>
- <obsoleteVersion>9</obsoleteVersion>
+   <obsoleteVersion>9</obsoleteVersion>
- <logFileNumber>2</logFileNumber>
+   <logFileNumber>2</logFileNumber>
- <previousLogRecordEndInstant>
+   <previousLogRecordEndInstant>
- <logFileNumber>1</logFileNumber>
+     <logFileNumber>1</logFileNumber>
- <position>11510</position>
+     <position>11510</position>
- </previousLogRecordEndInstant>
+   </previousLogRecordEndInstant>
- <logRecords>
+   <logRecords>
- </logRecords>
+   </logRecords>
- <recordCount>0</recordCount>
+   <recordCount>0</recordCount>
- </logFile>
+ </logFile> 
+ }}}
- 
- ------------------------------------------------------------
  
  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>
+ <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>
+   <logRecords>
- <wrapper>
+     <wrapper>
- <forwardLength>1818</forwardLength>
+       <forwardLength>1818</forwardLength>
- <logInstant>
+       <logInstant>
- <logFileNumber>2</logFileNumber>
+         <logFileNumber>2</logFileNumber>
- <position>29363</position>
+         <position>29363</position>
- </logInstant>
+       </logInstant>
- <logRecord>
+       <logRecord>
- <formatableID>129</formatableID>
+         <formatableID>129</formatableID>
- <groups hexvalue="180">
+         <groups hexvalue="180">
- <flag>XA_NEEDLOCK</flag>
+           <flag>XA_NEEDLOCK</flag>
- <flag>RAWSTORE</flag>
+           <flag>RAWSTORE</flag>
- </groups>
+         </groups>
- <transactionID value="192"/>
+         <transactionID value="192"/>
- <operation type="org.apache.derby.impl.store.raw.data.PurgeOperation">
+         <operation type="org.apache.derby.impl.store.raw.data.PurgeOperation">
- <details>Page Operation: Page(2,Container(0, 81)) pageVersion 75 : Purge : 36 slots
starting at 37 (recordId=43) (recordId=44) (recordId=45) (recordId=46) (recordId=47) (recordId=48)
(recordId=49) (recordId=50) (recordId=51) (recordId=52) (recordId=53) (recordId=54) (recordId=55)
(recordId=56) (recordId=57) (recordId=58) (recordId=59) (recordId=60) (recordId=61) (recordId=62)
(recordId=63) (recordId=64) (recordId=65) (recordId=66) (recordId=67) (recordId=68) (recordId=69)
(recordId=70) (recordId=71) (recordId=72) (recordId=73) (recordId=74) (recordId=75) (recordId=76)
(recordId=77) (recordId=78)</details>
+           <details>Page Operation: Page(2,Container(0, 81)) pageVersion 75 : Purge
: 36 slots starting at 37 (recordId=43) (recordId=44) (recordId=45) (recordId=46) (recordId=47)
(recordId=48) (recordId=49) (recordId=50) (recordId=51) (recordId=52) (recordId=53) (recordId=54)
(recordId=55) (recordId=56) (recordId=57) (recordId=58) (recordId=59) (recordId=60) (recordId=61)
(recordId=62) (recordId=63) (recordId=64) (recordId=65) (recordId=66) (recordId=67) (recordId=68)
(recordId=69) (recordId=70) (recordId=71) (recordId=72) (recordId=73) (recordId=74) (recordId=75)
(recordId=76) (recordId=77) (recordId=78)</details>
- </operation>
+         </operation>
- </logRecord>
+       </logRecord>
- <backwardLength>1818</backwardLength>
+       <backwardLength>1818</backwardLength>
- </wrapper>
+     </wrapper>
- <wrapper>
+     <wrapper>
- <forwardLength>90</forwardLength>
+       <forwardLength>90</forwardLength>
- <logInstant>
+       <logInstant>
- <logFileNumber>2</logFileNumber>
+         <logFileNumber>2</logFileNumber>
- <position>31197</position>
+         <position>31197</position>
- </logInstant>
+       </logInstant>
- <logRecord>
+       <logRecord>
- <formatableID>129</formatableID>
+         <formatableID>129</formatableID>
- <groups hexvalue="180">
+         <groups hexvalue="180">
- <flag>XA_NEEDLOCK</flag>
+           <flag>XA_NEEDLOCK</flag>
- <flag>RAWSTORE</flag>
+           <flag>RAWSTORE</flag>
- </groups>
+         </groups>
- <transactionID value="192"/>
+         <transactionID value="192"/>
- <operation type="org.apache.derby.impl.store.raw.data.InsertOperation">
+         <operation type="org.apache.derby.impl.store.raw.data.InsertOperation">
- <details>Page Operation: Page(1,Container(0, 81)) pageVersion 147 : Insert : Slot=1
recordId=79</details>
+           <details>Page Operation: Page(1,Container(0, 81)) pageVersion 147 : Insert
: Slot=1 recordId=79</details>
- </operation>
+         </operation>
- </logRecord>
+       </logRecord>
- <backwardLength>90</backwardLength>
+       <backwardLength>90</backwardLength>
- </wrapper>
+     </wrapper>
- <wrapper>
+     <wrapper>
- <forwardLength>17</forwardLength>
+       <forwardLength>17</forwardLength>
- <logInstant>
+       <logInstant>
- <logFileNumber>2</logFileNumber>
+         <logFileNumber>2</logFileNumber>
- <position>31303</position>
+         <position>31303</position>
- </logInstant>
+       </logInstant>
- <logRecord>
+       <logRecord>
- <formatableID>129</formatableID>
+         <formatableID>129</formatableID>
- <groups hexvalue="112">
+         <groups hexvalue="112">
- <flag>LAST</flag>
+           <flag>LAST</flag>
- <flag>COMMIT</flag>
+           <flag>COMMIT</flag>
- <flag>RAWSTORE</flag>
+           <flag>RAWSTORE</flag>
- </groups>
+         </groups>
- <transactionID value="192"/>
+         <transactionID value="192"/>
- <operation type="org.apache.derby.impl.store.raw.xact.EndXact">
+         <operation type="org.apache.derby.impl.store.raw.xact.EndXact">
- <details>EndXact null Committed : transactionStatus = Committed</details>
+           <details>EndXact null Committed : transactionStatus = Committed</details>
- </operation>
+         </operation>
- </logRecord>
+       </logRecord>
- <backwardLength>17</backwardLength>
+       <backwardLength>17</backwardLength>
- </wrapper>
+     </wrapper>
- </logRecords>
+   </logRecords>
- <recordCount>3</recordCount>
+   <recordCount>3</recordCount>
- </logFile>
+ </logFile> }}}
  
- ------------------------------------------------------------
  ===== ControlFileReader =====
  
  This tool reads the control file in the log directory and pretty-prints it as an xml file.
  
  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>
+   <formatableID>128</formatableID>
- <obsoleteVersion>9</obsoleteVersion>
+   <obsoleteVersion>9</obsoleteVersion>
- <logCounter>
+   <logCounter>
- <logFileNumber>1</logFileNumber>
+     <logFileNumber>1</logFileNumber>
- <position>11369</position>
+     <position>11369</position>
- </logCounter>
+   </logCounter>
- <majorVersion>10</majorVersion>
+   <majorVersion>10</majorVersion>
- <minorVersion>9</minorVersion>
+   <minorVersion>9</minorVersion>
- <subversionRevision>1092193</subversionRevision>
+   <subversionRevision>1092193</subversionRevision>
- <flags flags="1">
+   <flags flags="1">
- <flag>IS_BETA_FLAG</flag>
+     <flag>IS_BETA_FLAG</flag>
- </flags>
+   </flags>
- </controlFile>
+ </controlFile> 
+ }}}
  
    This example shows it's from a database created before 10.9 was released (as it has the
BETA flag), built using jars.
  
    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>
@@ -446, +436 @@

      <subversionRevision>1</subversionRevision>
      <flags flags="0"/>
      <checksum>0</checksum>
- </controlFile>
+ </controlFile> 
+ }}}
  
     This example shows this toursdb database was created using 10.10, after the first release
on the branch (no beta flag), but using classes, not jars, so there is no subversion number.
  

Mime
View raw message