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 "DatabaseConsistencyCheck" by KatheyMarsden
Date Tue, 17 May 2011 21:09:29 GMT
Dear Wiki user,

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

The "DatabaseConsistencyCheck" page has been changed by KatheyMarsden.
http://wiki.apache.org/db-derby/DatabaseConsistencyCheck?action=diff&rev1=3&rev2=4

--------------------------------------------------

  6 rows selected
  }}}
  
+ 
+ 
+ == Repairing Corrupt Indexes found by the consistency check  ==
+ 
+ If you found corrupt indexes in the consistency check, you may be able to drop and recreate
them to get them back into a consistent state.
+ 
+   1. First exit ij or the jvm accessing the database, and make a tar zip copy of the database,
preserving date stamps if possible. This can be used to try to understand the root cause of
the corruption and to start over if you make a mistake or make things worse. A frequent cause
is corruption after restore if proper online database procedures were not used. Ask derby-user@apache.org
for help.
+ 
+   1. Run dblook to get the ddl for the database, e.g.
+     {{{ java org.apache.derby.tools.dblook -d jdbc:derby:mydb > mydb_ddl_sql.out }}}
+   
+   1. For each index that was problematic in the consistency check, drop the index, e.g.
+      {{{ DROP INDEX APP.SQL051121040009780 }}}
+    
+     Then look in the dblook output for the index name for the exact syntax to recreate it.
+      
+   1. Do an offline compress of all the tables.  Below is some sample code for doing this:
+   [[attachment:CompressAll.java]]
+   
+   1. Without knowing the exact cause of the corruption, it is quite possible there is other
corruption unseen.  The only way to be 100% certain the database is ok is to manually check
the data, export it, create a new database using the dblook output and import the data.
+ 

Mime
View raw message