Return-Path: X-Original-To: apmail-db-derby-user-archive@www.apache.org Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8E8F6C85B for ; Mon, 7 May 2012 10:42:33 +0000 (UTC) Received: (qmail 59293 invoked by uid 500); 7 May 2012 10:42:33 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 59121 invoked by uid 500); 7 May 2012 10:42:29 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 59095 invoked by uid 99); 7 May 2012 10:42:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2012 10:42:29 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kristian.waagan@oracle.com designates 141.146.126.227 as permitted sender) Received: from [141.146.126.227] (HELO acsinet15.oracle.com) (141.146.126.227) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2012 10:42:19 +0000 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q47Afvsd029600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 7 May 2012 10:41:57 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q47Afu6I025165 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 7 May 2012 10:41:56 GMT Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q47AfuLd025843 for ; Mon, 7 May 2012 05:41:56 -0500 Received: from [192.168.0.20] (/84.215.180.161) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 May 2012 03:41:56 -0700 Message-ID: <4FA7A6EE.2010602@oracle.com> Date: Mon, 07 May 2012 12:41:50 +0200 From: Kristian Waagan User-Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:10.0.2) Gecko/20120223 Thunderbird/10.0.2 MIME-Version: 1.0 To: derby-user@db.apache.org Subject: Re: Derby database References: <4FA4FD4F.6060904@apache.org> In-Reply-To: <4FA4FD4F.6060904@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Virus-Checked: Checked by ClamAV on apache.org On 05.05.12 12:13, Aristedes Maniatis wrote: > Running Derby 10.8, a customer has managed to corrupt their database > somehow (possibly by forcing the database to quit when it did not shut > down fast enough to their liking). I see that when I connect to it with > ij in embedded mode, I get the following: > > ERROR 40XD2: Container Container(0, 36049) cannot be opened; it either > has been dropped or does not exist. Hi Ari, Do you have the stack trace for this exception? The exception can be thrown from a few places, although the one in BaseDataFileFactory seems the most likely one. Do you know when this exception was first seen? Any other interesting errors in derby.log? Are you aware of any power outages during this period, and if so, do you know if the write cache on the disk has been disabled? (it should be for durability) > > My reading so far suggests that page 0 of some data with id 36049 is > corrupt. Is there further diagnostics I can do to determine whether this > data is just an index which could be rebuilt or something else? Are > there further tools I can use to progress? Can I excise the bad data and > manually replace it later? The 0 refers to segment zero. Derby currently only supports one segment, so it is always zero. The container 36049 would live in the file seg0/c8cd1.dat - do you have that file? Your options for recovery depends on the data and the schema in the database, and would require full understanding of the relationships between the different tables etc: o if you have the file and it is corrupt, you, or the Derby developers, may be able to extract something useful out of it. Before share anything you have to determine if distributing the data is acceptable to your customer. o if the file is gone, you may be able to boot the database and investigate further, but the data would likely be inconsistent. The best thing that could happen here is that it is an index you can drop and recreate. > > I can restore from backup, however the loss of a day's work since that > backup would be unfortunate. It does not appear that rollforward logs > were enabled. > > mysql has a startup mode which allows it to start up in the face of data > corruption and then attempt recovery. Does Derby have a similar concept? No, not in terms of missing and/or destroyed conglomerates. Recovery in terms of redo/undo, for instance if the VM crashes, is performed automatically when the database is booted. Regards, -- Kristian > > Regards > > Ari > >